Class: Degica::Collection

Inherits:
Array
  • Object
show all
Includes:
Actionable
Defined in:
lib/degica/collection.rb

Direct Known Subclasses

DoorCollection, ObjectCollection

Instance Method Summary collapse

Methods included from Actionable

#describe, #do, #prompt

Constructor Details

#initialize(items = []) ⇒ Collection

Returns a new instance of Collection.



10
11
12
13
14
15
# File 'lib/degica/collection.rb', line 10

def initialize(items = [])
  items.each do |item|
    item.collection = self
  end
  super(items)
end

Instance Method Details

#<<(item) ⇒ Object



17
18
19
20
# File 'lib/degica/collection.rb', line 17

def <<(item)
  item.collection = self
  push(item)
end

#actionsObject



22
23
24
# File 'lib/degica/collection.rb', line 22

def actions
  []
end