class Controll::Enabler::PathResolver

Constants

Action
ActionMapper

Attributes

caller[R]
controller[R]
event_map[R]

Public Class Methods

new(caller, event_map) click to toggle source
# File lib/controll/enabler/path_resolver.rb, line 8
def initialize caller, event_map
  @caller     = caller
  @event_map = event_map
end

Public Instance Methods

resolve(action = nil) click to toggle source
# File lib/controll/enabler/path_resolver.rb, line 13
def resolve action = nil
  @path ||= handle action
end

Protected Instance Methods

handle(action) click to toggle source
# File lib/controll/enabler/path_resolver.rb, line 23
def handle action
  case action
  when Action::Fallback
    nil
  when Action::PathAction
    action.resolved_path
  when Symbol, Controll::Event
    resolve_event action
  else
    resolve_event
  end      
rescue Controll::Flow::PathActionError
  nil            
end
mapper() click to toggle source
# File lib/controll/enabler/path_resolver.rb, line 43
def mapper
  @mapper ||= Controll::Flow::EventMapper::Util.new main_event, event_map
end
resolve_event(event = nil) click to toggle source
# File lib/controll/enabler/path_resolver.rb, line 38
def resolve_event event = nil
  notify event if event
  mapper.map_event
end