Class: Grape::Router::GreedyRoute

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/grape/router/greedy_route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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:, **options)
  @index = index
  @pattern = pattern
  @options = options
  @attributes = Grape::Router::AttributeTranslator.new(**options)
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#indexObject (readonly)

Returns the value of attribute index.



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

def index
  @index
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#patternObject (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