Class: VertxWeb::Router

Inherits:
Object
  • Object
show all
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)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

Parameters:

Returns:



158
159
160
161
162
163
164
165
166
167
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 158

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

- (self) allowForward(allow)

Set whether the router should parse "forwarded"-type headers

Parameters:

  • allow (true, false)
    to enable parsing of "forwarded"-type headers

Returns:

  • (self)


58
59
60
61
62
63
64
65
66
67
68
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 58

def allow_forward(*args)
  if (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given?
    @j_del.java_method(:allowForward, [Java::boolean.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling allow_forward(#{args[0]})"
  end
end

- (self) clear

Remove all the routes from this router

Returns:

  • (self)


332
333
334
335
336
337
338
339
340
341
342
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 332

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

Overloads:

  • - (::VertxWeb::Route) connect(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



268
269
270
271
272
273
274
275
276
277
278
279
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 268

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



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 239

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

Overloads:

  • - (::VertxWeb::Route) delete(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



74
75
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/router.rb', line 74

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



514
515
516
517
518
519
520
521
522
523
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 514

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

- (self) 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.

Parameters:

  • statusCode (Fixnum)
    status code the errorHandler is capable of handle

Yields:

Returns:

  • (self)


455
456
457
458
459
460
461
462
463
464
465
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 455

def error_handler(*args)
  if args[0].class == Fixnum && true
    @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? }))
    return self
  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.

Yields:

  • the exception handler

Returns:

  • (self)


485
486
487
488
489
490
491
492
493
494
495
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 485

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

Overloads:

  • - (::VertxWeb::Route) get(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



190
191
192
193
194
195
196
197
198
199
200
201
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 190

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

Returns:



387
388
389
390
391
392
393
394
395
396
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 387

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



500
501
502
503
504
505
506
507
508
509
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 500

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.

Parameters:



347
348
349
350
351
352
353
354
355
356
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 347

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.

Parameters:



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.

Parameters:



361
362
363
364
365
366
367
368
369
370
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 361

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

Overloads:

  • - (::VertxWeb::Route) head(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



125
126
127
128
129
130
131
132
133
134
135
136
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 125

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



303
304
305
306
307
308
309
310
311
312
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 303

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) modifiedHandler(handler) { ... }

When a Router routes are changed this handler is notified. This is useful for routes that depend on the state of the router.

Yields:

  • a notification handler that will receive this router as argument

Returns:

  • (self)


207
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 207

def modified_handler
  if true
    @j_del.java_method(:modifiedHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWeb::Router)) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling modified_handler()"
  end
end

- (self) mountSubRouter(mountPoint, subRouter)

Mount a sub router on this router

Parameters:

  • mountPoint (String)
    the mount point (path prefix) to mount it on
  • subRouter (::VertxWeb::Router)
    the router to mount as a sub router

Returns:

  • (self)


318
319
320
321
322
323
324
325
326
327
328
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 318

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

Overloads:

  • - (::VertxWeb::Route) options(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



223
224
225
226
227
228
229
230
231
232
233
234
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 223

def options(*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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



470
471
472
473
474
475
476
477
478
479
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 470

def options_with_regex(*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

Overloads:

  • - (::VertxWeb::Route) patch(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



108
109
110
111
112
113
114
115
116
117
118
119
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 108

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



437
438
439
440
441
442
443
444
445
446
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 437

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

Overloads:

  • - (::VertxWeb::Route) post(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



173
174
175
176
177
178
179
180
181
182
183
184
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 173

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



253
254
255
256
257
258
259
260
261
262
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 253

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

Overloads:

  • - (::VertxWeb::Route) put(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



91
92
93
94
95
96
97
98
99
100
101
102
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 91

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



401
402
403
404
405
406
407
408
409
410
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 401

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

Overloads:

  • - (::VertxWeb::Route) route(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match
  • - (::VertxWeb::Route) route(method, path)

    Parameters:

    • method (:OPTIONS, :GET, :HEAD, :POST, :PUT, :DELETE, :TRACE, :CONNECT, :PATCH, :OTHER)
      the HTTP method to match
    • path (String)
      URI paths that begin with this path will match

Returns:



419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 419

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

Overloads:

  • - (::VertxWeb::Route) routeWithRegex(regex)

    Parameters:

    • regex (String)
      URI paths that begin with a match for this regex will match
  • - (::VertxWeb::Route) routeWithRegex(method, regex)

    Parameters:

    • method (:OPTIONS, :GET, :HEAD, :POST, :PUT, :DELETE, :TRACE, :CONNECT, :PATCH, :OTHER)
      the HTTP method to match
    • regex (String)
      URI paths that begin with a match for this regex will match

Returns:



287
288
289
290
291
292
293
294
295
296
297
298
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 287

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

Overloads:

  • - (::VertxWeb::Route) trace(path)

    Parameters:

    • path (String)
      URI paths that begin with this path will match

Returns:



142
143
144
145
146
147
148
149
150
151
152
153
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/router.rb', line 142

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

Parameters:

  • regex (String)
    URI paths that begin with a match for this regex will match

Returns:



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 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