Class: Grape::Router::GreedyRoute

Inherits:
BaseRoute
  • Object
show all
Defined in:
lib/grape/router/greedy_route.rb

Instance Attribute Summary

Attributes inherited from BaseRoute

#index, #options, #pattern

Instance Method Summary collapse

Methods inherited from BaseRoute

#pattern_regexp, #regexp_capture_index, #to_regexp

Constructor Details

#initialize(pattern:, **options) ⇒ GreedyRoute

Returns a new instance of GreedyRoute.



9
10
11
12
# File 'lib/grape/router/greedy_route.rb', line 9

def initialize(pattern:, **options)
  @pattern = pattern
  super(**options)
end

Instance Method Details

#params(_input = nil) ⇒ Object

Grape::Router:Route defines params as a function



15
16
17
# File 'lib/grape/router/greedy_route.rb', line 15

def params(_input = nil)
  options[:params] || {}
end