Class: VertxAuthOauth2::OAuth2Response
- Inherits:
-
Object
- Object
- VertxAuthOauth2::OAuth2Response
show all
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb
Overview
A response from a fetch request.
This class represents a secure response from a Oauth2 fetch call.
A fetch is a simplified HTTP response from a protected resource.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
Class Method Details
+ (Boolean) accept?(obj)
24
25
26
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 24
def @@j_api_type.accept?(obj)
obj.class == OAuth2Response
end
|
+ (Object) j_api_type
33
34
35
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 33
def self.j_api_type
@@j_api_type
end
|
+ (Object) j_class
36
37
38
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 36
def self.j_class
Java::IoVertxExtAuthOauth2::OAuth2Response.java_class
end
|
+ (Object) unwrap(obj)
30
31
32
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 30
def @@j_api_type.unwrap(obj)
obj.j_del
end
|
+ (Object) wrap(obj)
27
28
29
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 27
def @@j_api_type.wrap(obj)
OAuth2Response.new(obj)
end
|
Instance Method Details
The HTTP response body as a buffer
83
84
85
86
87
88
89
90
91
92
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 83
def body
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:body, []).call(),::Vertx::Buffer)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling body()"
end
end
|
Looks up a HTTP response header by name, in case where the response is a list of headers,
the first one is returned.
111
112
113
114
115
116
117
118
119
120
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 111
def (*args)
if args[0].class == String && !block_given?
return @j_del.java_method(:getHeader, [Java::java.lang.String.java_class]).call(args[0])
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling get_header(#{args[0]})"
end
end
|
The HTTP response headers from the HTTP layer.
42
43
44
45
46
47
48
49
50
51
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 42
def
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:headers, []).call(),::Vertx::MultiMap)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling headers()"
end
end
|
- (true, false) is(contentType)
Helper to analize the response body. The test is performed against the header Content-Type,
the content of the body is not analyzed.
57
58
59
60
61
62
63
64
65
66
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 57
def is?(*args)
if args[0].class == String && !block_given?
return @j_del.java_method(:is, [Java::java.lang.String.java_class]).call(args[0])
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling is?(#{args[0]})"
end
end
|
- (Array<String,Object>) jsonArray
The HTTP response body as a JsonArray
96
97
98
99
100
101
102
103
104
105
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 96
def json_array
if !block_given?
return @j_del.java_method(:jsonArray, []).call() != nil ? JSON.parse(@j_del.java_method(:jsonArray, []).call().encode) : nil
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling json_array()"
end
end
|
- (Hash{String => Object}) jsonObject
The HTTP response body as a JsonObject
70
71
72
73
74
75
76
77
78
79
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 70
def json_object
if !block_given?
return @j_del.java_method(:jsonObject, []).call() != nil ? JSON.parse(@j_del.java_method(:jsonObject, []).call().encode) : nil
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling json_object()"
end
end
|
- (Fixnum) statusCode
the returned status code from the HTTP layer.
124
125
126
127
128
129
130
131
132
133
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/o_auth2_response.rb', line 124
def status_code
if !block_given?
return @j_del.java_method(:statusCode, []).call()
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling status_code()"
end
end
|