Class: Signpost::Endpoint::Dynamic

Inherits:
Object
  • Object
show all
Defined in:
lib/signpost/endpoint/dynamic.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/signpost/endpoint/dynamic.rb', line 4

def call(env)
  controller, action = env[@params_key].values_at('controller', 'action')

  resolver = Resolver.new({
    controller: @spec[:controller] || controller,
    action: @spec[:action] || action
  }, @options).resolve

  resolver.endpoint.call(env)
end