Class: Moku6::Catalog
- Inherits:
-
Object
- Object
- Moku6::Catalog
- Defined in:
- lib/moku6/catalog.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
: Array.
Instance Method Summary collapse
-
#actions ⇒ Object
: () -> Array.
-
#empty? ⇒ Boolean
: () -> bool.
-
#find(action) ⇒ Object
: (String? action) -> Event?.
-
#initialize(events) ⇒ Catalog
constructor
: (Array events) -> void.
-
#sorted ⇒ Object
: () -> Array.
Constructor Details
Instance Attribute Details
#events ⇒ Object (readonly)
: Array
6 7 8 |
# File 'lib/moku6/catalog.rb', line 6 def events @events end |
Instance Method Details
#actions ⇒ Object
: () -> Array
12 |
# File 'lib/moku6/catalog.rb', line 12 def actions = events.map(&:action) |
#empty? ⇒ Boolean
: () -> bool
21 |
# File 'lib/moku6/catalog.rb', line 21 def empty? = events.empty? |
#find(action) ⇒ Object
: (String? action) -> Event?
18 |
# File 'lib/moku6/catalog.rb', line 18 def find(action) = events.find { |e| e.action == action } |
#sorted ⇒ Object
: () -> Array
15 |
# File 'lib/moku6/catalog.rb', line 15 def sorted = events.sort_by { |e| e.action.to_s } |