Class: VertxWebClient::ErrorConverter
- Inherits:
-
Object
- Object
- VertxWebClient::ErrorConverter
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb
Overview
Converts a ResponsePredicateResult to a
Throwable
describing the error.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (::VertxWebClient::ErrorConverter) create(converter) { ... }
Creates a full ErrorConverter, that will passed a predicate result with the response body.
-
+ (::VertxWebClient::ErrorConverter) createFullBody(converter) { ... }
Creates a full ErrorConverter, that will passed a predicate result with the response body.
- + (Object) DEFAULT_CONVERTER
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
- - (Exception) apply(result)
-
- (true, false) requiresBody
true when the converter wants to process the request body.
Class Method Details
+ (Boolean) accept?(obj)
19 20 21 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 19 def @@j_api_type.accept?(obj) obj.class == ErrorConverter end |
+ (::VertxWebClient::ErrorConverter) create(converter) { ... }
Creates a full VertxWebClient::ErrorConverter, that will passed a predicate result with the response body.
The converter
function will be invoked after the HTTP response body is received.
81 82 83 84 85 86 87 88 89 90 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 81 def self.create(*args) if block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ErrorConverter.java_method(:create, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| ::Vertx::Util::Utils.to_throwable(yield(::Vertx::Util::Utils.safe_create(event,::VertxWebClient::ResponsePredicateResult))) unless !block_given? })),::VertxWebClient::ErrorConverter) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling create(#{args[0]})" end end |
+ (::VertxWebClient::ErrorConverter) createFullBody(converter) { ... }
Creates a full VertxWebClient::ErrorConverter, that will passed a predicate result with the response body.
The converter
function will be invoked after the HTTP response body is received.
53 54 55 56 57 58 59 60 61 62 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 53 def self.create_full_body(*args) if block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ErrorConverter.java_method(:createFullBody, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| ::Vertx::Util::Utils.to_throwable(yield(::Vertx::Util::Utils.safe_create(event,::VertxWebClient::ResponsePredicateResult))) unless !block_given? })),::VertxWebClient::ErrorConverter) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling create_full_body(#{args[0]})" end end |
+ (Object) DEFAULT_CONVERTER
91 92 93 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 91 def self.DEFAULT_CONVERTER ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ErrorConverter.DEFAULT_CONVERTER,::VertxWebClient::ErrorConverter) end |
+ (Object) j_api_type
28 29 30 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 28 def self.j_api_type @@j_api_type end |
+ (Object) j_class
31 32 33 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 31 def self.j_class Java::IoVertxExtWebClientPredicate::ErrorConverter.java_class end |
+ (Object) unwrap(obj)
25 26 27 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 25 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
22 23 24 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 22 def @@j_api_type.wrap(obj) ErrorConverter.new(obj) end |
Instance Method Details
- (Exception) apply(result)
37 38 39 40 41 42 43 44 45 46 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 37 def apply(*args) if args[0].class.method_defined?(:j_del) && !block_given? return ::Vertx::Util::Utils.from_throwable(@j_del.java_method(:apply, [Java::IoVertxExtWebClientPredicate::ResponsePredicateResult.java_class]).call(args[0].j_del)) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling apply(#{args[0]})" end end |
- (true, false) requiresBody
Returns
true
when the converter wants to process the request body.
65 66 67 68 69 70 71 72 73 74 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/error_converter.rb', line 65 def requires_body? if !block_given? return @j_del.java_method(:requiresBody, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling requires_body?()" end end |