Class: VertxWeb::Router
- Inherits:
-
Object
- Object
- VertxWeb::Router
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb
Overview
A router receives request from an Vertx::HttpServer and routes it to the first matching
Route that it contains. A router can contain many routes.
Routers are also used for routing failures.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
-
+ (::VertxWeb::Router) router(vertx)
Create a router.
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (void) accept(request)
This method is used to provide a request to the router.
-
- (self) clear
Remove all the routes from this router.
-
- (::VertxWeb::Route) connect(*args)
Add a route that matches a HTTP CONNECT request and the specified path.
-
- (::VertxWeb::Route) connectWithRegex(regex)
Add a route that matches a HTTP CONNECT request and the specified path regex.
-
- (::VertxWeb::Route) delete(*args)
Add a route that matches a HTTP DELETE request and the specified path.
-
- (::VertxWeb::Route) deleteWithRegex(regex)
Add a route that matches a HTTP DELETE request and the specified path regex.
-
- (::VertxWeb::Router) errorHandler(statusCode, errorHandler) { ... }
Specify an handler to handle an error for a particular status code.
-
- (self) exceptionHandler(exceptionHandler) { ... }
Specify a handler for any unhandled exceptions on this router.
-
- (::VertxWeb::Route) get(*args)
Add a route that matches a HTTP GET request and the specified path.
-
- (Array<::VertxWeb::Route>) getRoutes
A list of all the routes on this router.
-
- (::VertxWeb::Route) getWithRegex(regex)
Add a route that matches a HTTP GET request and the specified path regex.
-
- (void) handle(event)
Something has happened, so handle it.
-
- (void) handleContext(context)
Used to route a context to the router.
-
- (void) handleFailure(context)
Used to route a failure to the router.
-
- (::VertxWeb::Route) head(*args)
Add a route that matches a HTTP HEAD request and the specified path.
-
- (::VertxWeb::Route) headWithRegex(regex)
Add a route that matches a HTTP HEAD request and the specified path regex.
-
- (self) mountSubRouter(mountPoint, subRouter)
Mount a sub router on this router.
-
- (::VertxWeb::Route) options(*args)
Add a route that matches a HTTP OPTIONS request and the specified path.
-
- (::VertxWeb::Route) optionsWithRegex(regex)
Add a route that matches a HTTP OPTIONS request and the specified path regex.
-
- (::VertxWeb::Route) patch(*args)
Add a route that matches a HTTP PATCH request and the specified path.
-
- (::VertxWeb::Route) patchWithRegex(regex)
Add a route that matches a HTTP PATCH request and the specified path regex.
-
- (::VertxWeb::Route) post(*args)
Add a route that matches a HTTP POST request and the specified path.
-
- (::VertxWeb::Route) postWithRegex(regex)
Add a route that matches a HTTP POST request and the specified path regex.
-
- (::VertxWeb::Route) put(*args)
Add a route that matches a HTTP PUT request and the specified path.
-
- (::VertxWeb::Route) putWithRegex(regex)
Add a route that matches a HTTP PUT request and the specified path regex.
-
- (::VertxWeb::Route) route(*args)
Add a route that matches the specified HTTP method and path.
-
- (::VertxWeb::Route) route_with_regex(*args)
Add a route that matches the specified HTTP method and path regex.
-
- (::VertxWeb::Route) trace(*args)
Add a route that matches a HTTP TRACE request and the specified path.
-
- (::VertxWeb::Route) traceWithRegex(regex)
Add a route that matches a HTTP TRACE request and the specified path regex.
Class Method Details
+ (Boolean) accept?(obj)
25 26 27 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 25 def @@j_api_type.accept?(obj) obj.class == Router end |
+ (Object) j_api_type
34 35 36 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 34 def self.j_api_type @@j_api_type end |
+ (Object) j_class
37 38 39 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 37 def self.j_class Java::IoVertxExtWeb::Router.java_class end |
+ (::VertxWeb::Router) router(vertx)
Create a router
143 144 145 146 147 148 149 150 151 152 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 143 def self.router(*args) if args[0].class.method_defined?(:j_del) && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWeb::Router.java_method(:router, [Java::IoVertxCore::Vertx.java_class]).call(args[0].j_del),::VertxWeb::Router) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling router(#{args[0]})" end end |
+ (Object) unwrap(obj)
31 32 33 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 31 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
28 29 30 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 28 def @@j_api_type.wrap(obj) Router.new(obj) end |
Instance Method Details
- (void) accept(request)
This method returns an undefined value.
This method is used to provide a request to the router. Usually you take request from the Vertx::HttpServer#request_handler and pass it to this method. The router then routes it to matching routes. This method is now deprecated you can use this object directly as a request handler, which means there is no need for a method reference anymore.
349 350 351 352 353 354 355 356 357 358 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 349 def accept(*args) if args[0].class.method_defined?(:j_del) && !block_given? return @j_del.java_method(:accept, [Java::IoVertxCoreHttp::HttpServerRequest.java_class]).call(args[0].j_del) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling accept(#{args[0]})" end end |
- (self) clear
Remove all the routes from this router
301 302 303 304 305 306 307 308 309 310 311 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 301 def clear if !block_given? @j_del.java_method(:clear, []).call() return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling clear()" end end |
- (::VertxWeb::Route) connect - (::VertxWeb::Route) connect(path)
Add a route that matches a HTTP CONNECT request and the specified path
237 238 239 240 241 242 243 244 245 246 247 248 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 237 def connect(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:connect, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:connect, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling connect(#{args[0]})" end end |
- (::VertxWeb::Route) connectWithRegex(regex)
Add a route that matches a HTTP CONNECT request and the specified path regex
208 209 210 211 212 213 214 215 216 217 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 208 def connect_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:connectWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling connect_with_regex(#{args[0]})" end end |
- (::VertxWeb::Route) delete - (::VertxWeb::Route) delete(path)
Add a route that matches a HTTP DELETE request and the specified path
59 60 61 62 63 64 65 66 67 68 69 70 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 59 def delete(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:delete, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:delete, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling delete(#{args[0]})" end end |
- (::VertxWeb::Route) deleteWithRegex(regex)
Add a route that matches a HTTP DELETE request and the specified path regex
501 502 503 504 505 506 507 508 509 510 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 501 def delete_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:deleteWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling delete_with_regex(#{args[0]})" end end |
- (::VertxWeb::Router) errorHandler(statusCode, errorHandler) { ... }
Specify an handler to handle an error for a particular status code. You can use to manage general errors too using status code 500.
The handler will be called when the context fails and other failure handlers didn't write the reply or when an exception is thrown inside an handler.
You must not use VertxWeb::RoutingContext#next inside the error handler
This does not affect the normal failure routing logic.
443 444 445 446 447 448 449 450 451 452 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 443 def error_handler(*args) if args[0].class == Fixnum && true return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:errorHandler, [Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWeb::RoutingContext)) unless !block_given? })),::VertxWeb::Router) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling error_handler(#{args[0]})" end end |
- (self) exceptionHandler(exceptionHandler) { ... }
Specify a handler for any unhandled exceptions on this router. The handler will be called for exceptions thrown
from handlers. This does not affect the normal failure routing logic.
472 473 474 475 476 477 478 479 480 481 482 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 472 def exception_handler if true @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling exception_handler()" end end |
- (::VertxWeb::Route) get - (::VertxWeb::Route) get(path)
Add a route that matches a HTTP GET request and the specified path
175 176 177 178 179 180 181 182 183 184 185 186 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 175 def get(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:get, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:get, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling get(#{args[0]})" end end |
- (Array<::VertxWeb::Route>) getRoutes
Returns a list of all the routes on this router
375 376 377 378 379 380 381 382 383 384 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 375 def get_routes if !block_given? return @j_del.java_method(:getRoutes, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::Route) } end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling get_routes()" end end |
- (::VertxWeb::Route) getWithRegex(regex)
Add a route that matches a HTTP GET request and the specified path regex
487 488 489 490 491 492 493 494 495 496 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 487 def get_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling get_with_regex(#{args[0]})" end end |
- (void) handle(event)
This method returns an undefined value.
Something has happened, so handle it.
316 317 318 319 320 321 322 323 324 325 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 316 def handle(*args) if args[0].class.method_defined?(:j_del) && !block_given? return @j_del.java_method(:handle, [Java::IoVertxCoreHttp::HttpServerRequest.java_class]).call(args[0].j_del) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling handle(#{args[0]})" end end |
- (void) handleContext(context)
This method returns an undefined value.
Used to route a context to the router. Used for sub-routers. You wouldn't normally call this method directly.
44 45 46 47 48 49 50 51 52 53 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 44 def handle_context(*args) if args[0].class.method_defined?(:j_del) && !block_given? return @j_del.java_method(:handleContext, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(args[0].j_del) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling handle_context(#{args[0]})" end end |
- (void) handleFailure(context)
This method returns an undefined value.
Used to route a failure to the router. Used for sub-routers. You wouldn't normally call this method directly.
330 331 332 333 334 335 336 337 338 339 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 330 def handle_failure(*args) if args[0].class.method_defined?(:j_del) && !block_given? return @j_del.java_method(:handleFailure, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(args[0].j_del) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling handle_failure(#{args[0]})" end end |
- (::VertxWeb::Route) head - (::VertxWeb::Route) head(path)
Add a route that matches a HTTP HEAD request and the specified path
110 111 112 113 114 115 116 117 118 119 120 121 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 110 def head(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:head, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:head, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling head(#{args[0]})" end end |
- (::VertxWeb::Route) headWithRegex(regex)
Add a route that matches a HTTP HEAD request and the specified path regex
272 273 274 275 276 277 278 279 280 281 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 272 def head_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:headWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling head_with_regex(#{args[0]})" end end |
- (self) mountSubRouter(mountPoint, subRouter)
Mount a sub router on this router
287 288 289 290 291 292 293 294 295 296 297 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 287 def mount_sub_router(*args) if args[0].class == String && args[1].class.method_defined?(:j_del) && !block_given? @j_del.java_method(:mountSubRouter, [Java::java.lang.String.java_class,Java::IoVertxExtWeb::Router.java_class]).call(args[0],args[1].j_del) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling mount_sub_router(#{args[0]},#{args[1]})" end end |
- (::VertxWeb::Route) options - (::VertxWeb::Route) options(path)
Add a route that matches a HTTP OPTIONS request and the specified path
192 193 194 195 196 197 198 199 200 201 202 203 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 192 def (*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:options, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:options, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling options(#{args[0]})" end end |
- (::VertxWeb::Route) optionsWithRegex(regex)
Add a route that matches a HTTP OPTIONS request and the specified path regex
457 458 459 460 461 462 463 464 465 466 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 457 def (*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:optionsWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling options_with_regex(#{args[0]})" end end |
- (::VertxWeb::Route) patch - (::VertxWeb::Route) patch(path)
Add a route that matches a HTTP PATCH request and the specified path
93 94 95 96 97 98 99 100 101 102 103 104 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 93 def patch(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:patch, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:patch, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling patch(#{args[0]})" end end |
- (::VertxWeb::Route) patchWithRegex(regex)
Add a route that matches a HTTP PATCH request and the specified path regex
425 426 427 428 429 430 431 432 433 434 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 425 def patch_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:patchWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling patch_with_regex(#{args[0]})" end end |
- (::VertxWeb::Route) post - (::VertxWeb::Route) post(path)
Add a route that matches a HTTP POST request and the specified path
158 159 160 161 162 163 164 165 166 167 168 169 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 158 def post(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:post, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:post, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling post(#{args[0]})" end end |
- (::VertxWeb::Route) postWithRegex(regex)
Add a route that matches a HTTP POST request and the specified path regex
222 223 224 225 226 227 228 229 230 231 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 222 def post_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:postWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling post_with_regex(#{args[0]})" end end |
- (::VertxWeb::Route) put - (::VertxWeb::Route) put(path)
Add a route that matches a HTTP PUT request and the specified path
76 77 78 79 80 81 82 83 84 85 86 87 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 76 def put(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:put, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:put, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling put(#{args[0]})" end end |
- (::VertxWeb::Route) putWithRegex(regex)
Add a route that matches a HTTP PUT request and the specified path regex
389 390 391 392 393 394 395 396 397 398 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 389 def put_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:putWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling put_with_regex(#{args[0]})" end end |
- (::VertxWeb::Route) route - (::VertxWeb::Route) route(path) - (::VertxWeb::Route) route(method, path)
Add a route that matches the specified HTTP method and path
407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 407 def route(*args) if !block_given? && args[0] == nil && args[1] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:route, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? && args[1] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:route, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) elsif args[0].class == Symbol && args[1].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:route, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(args[0].to_s),args[1]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling route(#{args[0]},#{args[1]})" end end |
- (::VertxWeb::Route) routeWithRegex(regex) - (::VertxWeb::Route) routeWithRegex(method, regex)
Add a route that matches the specified HTTP method and path regex
256 257 258 259 260 261 262 263 264 265 266 267 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 256 def route_with_regex(*args) if args[0].class == String && !block_given? && args[1] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:routeWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) elsif args[0].class == Symbol && args[1].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:routeWithRegex, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(args[0].to_s),args[1]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling route_with_regex(#{args[0]},#{args[1]})" end end |
- (::VertxWeb::Route) trace - (::VertxWeb::Route) trace(path)
Add a route that matches a HTTP TRACE request and the specified path
127 128 129 130 131 132 133 134 135 136 137 138 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 127 def trace(*args) if !block_given? && args[0] == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:trace, []).call(),::VertxWeb::Route) elsif args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:trace, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling trace(#{args[0]})" end end |
- (::VertxWeb::Route) traceWithRegex(regex)
Add a route that matches a HTTP TRACE request and the specified path regex
363 364 365 366 367 368 369 370 371 372 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 363 def trace_with_regex(*args) if args[0].class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:traceWithRegex, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::Route) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling trace_with_regex(#{args[0]})" end end |