Class: Monoz::ActionCollection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/monoz/action_collection.rb

Instance Method Summary collapse

Constructor Details

#initializeActionCollection

Returns a new instance of ActionCollection.



10
11
12
13
# File 'lib/monoz/action_collection.rb', line 10

def initialize
  @items = []
  populate_items
end

Instance Method Details

#allObject



23
24
25
# File 'lib/monoz/action_collection.rb', line 23

def all
  @items
end

#exist?(name) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/monoz/action_collection.rb', line 15

def exist?(name)
  !!find(name)
end

#find(name) ⇒ Object



19
20
21
# File 'lib/monoz/action_collection.rb', line 19

def find(name)
  @items.select { |i| i.name == name.to_s }&.first
end