class Praxis::BootloaderStages::Routing::Target

Attributes

action[R]

Public Class Methods

new(application, controller, action) click to toggle source
# File lib/praxis/bootloader_stages/routing.rb, line 9
def initialize(application, controller, action)
  @application = application
  @controller = controller
  @action = action
end

Public Instance Methods

call(request) click to toggle source
# File lib/praxis/bootloader_stages/routing.rb, line 15
def call(request)
  dispatcher = Dispatcher.current(application: @application)
  # Switch to the sister get action if configured that way (and mark the request as forwarded)
  action = \
    if @action.sister_get_action
      request.forwarded_from_action = @action
      @action.sister_get_action
    else
      @action
    end
  dispatcher.dispatch(@controller, action, request)
end