Class: Apotomo::InvokeEventHandler
- Inherits:
-
EventHandler
- Object
- EventHandler
- Apotomo::InvokeEventHandler
- Defined in:
- lib/apotomo/invoke_event_handler.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
Returns the value of attribute state.
-
#widget_id ⇒ Object
Returns the value of attribute widget_id.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ InvokeEventHandler
constructor
A new instance of InvokeEventHandler.
- #process_event(event) ⇒ Object
- #to_s ⇒ Object
Methods inherited from EventHandler
Constructor Details
#initialize(options = {}) ⇒ InvokeEventHandler
Returns a new instance of InvokeEventHandler.
7 8 9 10 |
# File 'lib/apotomo/invoke_event_handler.rb', line 7 def initialize(={}) @widget_id = [:widget_id] @state = [:state] end |
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
5 6 7 |
# File 'lib/apotomo/invoke_event_handler.rb', line 5 def state @state end |
#widget_id ⇒ Object
Returns the value of attribute widget_id.
5 6 7 |
# File 'lib/apotomo/invoke_event_handler.rb', line 5 def @widget_id end |
Instance Method Details
#process_event(event) ⇒ Object
12 13 14 15 16 |
# File 'lib/apotomo/invoke_event_handler.rb', line 12 def process_event(event) target = event.source.root.find_by_path() ### DISCUSS: widget_id or widget_selector? target.invoke(state, event) end |
#to_s ⇒ Object
18 |
# File 'lib/apotomo/invoke_event_handler.rb', line 18 def to_s; "InvokeEventHandler:#{}##{state}"; end |