Class: VertxWebGraphql::GraphiQLHandler
- Inherits:
-
Object
- Object
- VertxWebGraphql::GraphiQLHandler
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb
Overview
A VertxWeb::Route handler for GraphiQL resources.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (::VertxWebGraphql::GraphiQLHandler) create(*args)
Create a new GraphiQLHandler.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (self) graphiQLRequestHeaders(factory) { ... }
Customize the HTTP headers to add to GraphQL requests sent by the GraphiQL user interface.
-
- (void) handle(event)
Something has happened, so handle it.
Class Method Details
+ (Boolean) accept?(obj)
20 21 22 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 20 def @@j_api_type.accept?(obj) obj.class == GraphiQLHandler end |
+ (::VertxWebGraphql::GraphiQLHandler) create + (::VertxWebGraphql::GraphiQLHandler) create(options)
Create a new VertxWebGraphql::GraphiQLHandler.
The handler will be configured with the given options
.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 60 def self.create(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandlerGraphql::GraphiQLHandler.java_method(:create, []).call(),::VertxWebGraphql::GraphiQLHandler) elsif args[0].class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandlerGraphql::GraphiQLHandler.java_method(:create, [Java::IoVertxExtWebHandlerGraphql::GraphiQLHandlerOptions.java_class]).call(Java::IoVertxExtWebHandlerGraphql::GraphiQLHandlerOptions.new(::Vertx::Util::Utils.to_json_object(args[0]))),::VertxWebGraphql::GraphiQLHandler) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling create(#{args[0]})" end end |
+ (Object) j_api_type
29 30 31 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 29 def self.j_api_type @@j_api_type end |
+ (Object) j_class
32 33 34 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 32 def self.j_class Java::IoVertxExtWebHandlerGraphql::GraphiQLHandler.java_class end |
+ (Object) unwrap(obj)
26 27 28 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 26 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
23 24 25 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 23 def @@j_api_type.wrap(obj) GraphiQLHandler.new(obj) end |
Instance Method Details
- (self) graphiQLRequestHeaders(factory) { ... }
Customize the HTTP headers to add to GraphQL requests sent by the GraphiQL user interface.
The result will be applied on top of the fixed set of headers specified in => Object#get_headers}.
This can be useful if, for example, the server is protected by authentication.
42 43 44 45 46 47 48 49 50 51 52 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 42 def graphi_ql_request_headers(*args) if block_given? && args[0] == nil @j_del.java_method(:graphiQLRequestHeaders, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWeb::RoutingContext)).j_del unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling graphi_ql_request_headers(#{args[0]})" end end |
- (void) handle(event)
This method returns an undefined value.
Something has happened, so handle it.
76 77 78 79 80 81 82 83 84 85 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-graphql/graphi_ql_handler.rb', line 76 def handle(*args) if args[0].class.method_defined?(:j_del) && !block_given? return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(args[0].j_del) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling handle(#{args[0]})" end end |