Module: Group
- Defined in:
- tomes/spells/group.rb
Overview
A module for giving a Class the ability to log and track instances of itself.
Instance Method Summary collapse
-
#add(object) ⇒ Void
Adds an object to the list.
-
#delete(object) ⇒ Void
Removes an object from the list.
-
#list ⇒ Array
(also: #all)
An array of all the instances of a class being tracked.
Instance Method Details
#add(object) ⇒ Void
Adds an object to the list. This method should probably be called in #initialize.
11 12 13 |
# File 'tomes/spells/group.rb', line 11 def add(object) @list << object end |
#delete(object) ⇒ Void
Removes an object from the list.
18 19 20 |
# File 'tomes/spells/group.rb', line 18 def delete(object) @list.delete(object) end |
#list ⇒ Array Also known as: all
An array of all the instances of a class being tracked.
24 25 26 |
# File 'tomes/spells/group.rb', line 24 def list @list end |