Class: Controll::Events
- Inherits:
-
Object
- Object
- Controll::Events
- Includes:
- Controll::Event::Helper, Enumerable
- Defined in:
- lib/controll/events.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(event) ⇒ Object
- #each ⇒ Object
-
#initialize(*events) ⇒ Events
constructor
A new instance of Events.
- #last ⇒ Object
- #valid_types ⇒ Object
Methods included from Controll::Event::Helper
Constructor Details
#initialize(*events) ⇒ Events
Returns a new instance of Events.
8 9 10 |
# File 'lib/controll/events.rb', line 8 def initialize *events @events = events.flatten.map{|event| normalize event } end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
6 7 8 |
# File 'lib/controll/events.rb', line 6 def events @events end |
Class Method Details
.valid_types ⇒ Object
24 25 26 |
# File 'lib/controll/events.rb', line 24 def self.valid_types Controll::Event.valid_types end |
Instance Method Details
#<<(event) ⇒ Object
16 17 18 |
# File 'lib/controll/events.rb', line 16 def << event events << event end |
#each ⇒ Object
12 13 14 |
# File 'lib/controll/events.rb', line 12 def each events.each {|event| yield event } end |
#last ⇒ Object
20 21 22 |
# File 'lib/controll/events.rb', line 20 def last events.last end |
#valid_types ⇒ Object
44 45 46 |
# File 'lib/controll/events.rb', line 44 def valid_types Controll::Event.valid_types end |