Class: Controll::Flow::EventMapper::PathFinder
- Inherits:
-
Object
- Object
- Controll::Flow::EventMapper::PathFinder
- Includes:
- Event::Helper
- Defined in:
- lib/controll/flow/event_mapper/path_finder.rb
Constant Summary collapse
- NoMappingFoundError =
Controll::Flow::NoMappingFoundError
Instance Attribute Summary collapse
-
#event ⇒ Object
Returns the value of attribute event.
-
#maps ⇒ Object
Returns the value of attribute maps.
-
#types ⇒ Object
Returns the value of attribute types.
Instance Method Summary collapse
-
#initialize(event, maps, types = []) ⇒ PathFinder
constructor
event <Event>.
- #path ⇒ Object
Methods included from Event::Helper
Constructor Details
#initialize(event, maps, types = []) ⇒ PathFinder
event <Event>
9 10 11 12 13 14 15 |
# File 'lib/controll/flow/event_mapper/path_finder.rb', line 9 def initialize event, maps, types = [] raise ArgumentError, "Event argument must not be empty" if event.blank? raise ArgumentError, "Maps argument must not be empty" if maps.blank? @event = normalize event @types = types unless types.blank? @maps = maps end |
Instance Attribute Details
#event ⇒ Object
Returns the value of attribute event.
4 5 6 |
# File 'lib/controll/flow/event_mapper/path_finder.rb', line 4 def event @event end |
#maps ⇒ Object
Returns the value of attribute maps.
4 5 6 |
# File 'lib/controll/flow/event_mapper/path_finder.rb', line 4 def maps @maps end |
#types ⇒ Object
Returns the value of attribute types.
4 5 6 |
# File 'lib/controll/flow/event_mapper/path_finder.rb', line 4 def types @types end |
Instance Method Details
#path ⇒ Object
17 18 19 20 21 |
# File 'lib/controll/flow/event_mapper/path_finder.rb', line 17 def path @path ||= mapper.map_event rescue StandardError => e raise NoMappingFoundError, "No event mapping could be found for: #{event.inspect} in: #{maps}. Cause: #{e}" end |