Module: IsACollection::ClassMethods
- Defined in:
- lib/is_a_collection.rb
Instance Method Summary collapse
- #__collection ⇒ Object
- #__indices ⇒ Object
- #all ⇒ Object
- #clear_collection_indices ⇒ Object
- #find(identifier) ⇒ Object
Instance Method Details
#__collection ⇒ Object
60 61 62 |
# File 'lib/is_a_collection.rb', line 60 def __collection @__collection ||= {} end |
#__indices ⇒ Object
73 74 75 |
# File 'lib/is_a_collection.rb', line 73 def __indices @__indices ||= Hash.new{ |hash,key| hash[key] = Hash.new{ |hash1,key1| hash1[key1] = Set.new } } end |
#all ⇒ Object
63 64 65 |
# File 'lib/is_a_collection.rb', line 63 def all __collection.values end |
#clear_collection_indices ⇒ Object
69 70 71 72 |
# File 'lib/is_a_collection.rb', line 69 def clear_collection_indices @__collection = {} @__indices = Hash.new{ |hash,key| hash[key] = Hash.new{ |hash1,key1| hash1[key1] = Set.new } } end |
#find(identifier) ⇒ Object
66 67 68 |
# File 'lib/is_a_collection.rb', line 66 def find(identifier) __collection[identifier] end |