Class: Event
- Inherits:
-
Object
- Object
- Event
- Defined in:
- lib/gimuby/event/event.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name = nil?, , data = {}) ⇒ Event
constructor
A new instance of Event.
-
#trigger ⇒ Object
Trigger the event (through the event manager).
Constructor Details
#initialize(name = nil?, , data = {}) ⇒ Event
Returns a new instance of Event.
9 10 11 12 |
# File 'lib/gimuby/event/event.rb', line 9 def initialize(name = nil?, data = {}) @name = name @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
15 16 17 |
# File 'lib/gimuby/event/event.rb', line 15 def data @data end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/gimuby/event/event.rb', line 14 def name @name end |
Instance Method Details
#trigger ⇒ Object
Trigger the event (through the event manager)
19 20 21 22 |
# File 'lib/gimuby/event/event.rb', line 19 def trigger event_manager = get_event_manager event_manager.trigger_event(name, self) end |