Class: Grape::Router::GreedyRoute
- Inherits:
-
Object
- Object
- Grape::Router::GreedyRoute
- Extended by:
- Forwardable
- Defined in:
- lib/grape/router/greedy_route.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(index:, pattern:, **options) ⇒ GreedyRoute
constructor
A new instance of GreedyRoute.
-
#params(_input = nil) ⇒ Object
Grape::Router:Route defines params as a function.
Constructor Details
#initialize(index:, pattern:, **options) ⇒ GreedyRoute
Returns a new instance of GreedyRoute.
19 20 21 22 23 24 |
# File 'lib/grape/router/greedy_route.rb', line 19 def initialize(index:, pattern:, **) @index = index @pattern = pattern @options = @attributes = Grape::Router::AttributeTranslator.new(**) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
14 15 16 |
# File 'lib/grape/router/greedy_route.rb', line 14 def attributes @attributes end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
14 15 16 |
# File 'lib/grape/router/greedy_route.rb', line 14 def index @index end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/grape/router/greedy_route.rb', line 14 def @options end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
14 15 16 |
# File 'lib/grape/router/greedy_route.rb', line 14 def pattern @pattern end |
Instance Method Details
#params(_input = nil) ⇒ Object
Grape::Router:Route defines params as a function
27 28 29 |
# File 'lib/grape/router/greedy_route.rb', line 27 def params(_input = nil) @attributes.params || {} end |