Module: ActiveMongo::HasMany::ClassMethods
- Included in:
- Base
- Defined in:
- lib/active_mongo_has_many.rb
Instance Method Summary collapse
- #has_many(name, attrs = {}) ⇒ Object
- #internal_has_manies_get(name) ⇒ Object
- #internal_has_manies_set(name, attrs) ⇒ Object
Instance Method Details
#has_many(name, attrs = {}) ⇒ Object
4 5 6 |
# File 'lib/active_mongo_has_many.rb', line 4 def has_many(name, attrs = {}) internal_has_manies_set(name, attrs) end |
#internal_has_manies_get(name) ⇒ Object
14 15 16 17 18 |
# File 'lib/active_mongo_has_many.rb', line 14 def internal_has_manies_get(name) @@internal_has_manies ||= {} @@internal_has_manies[name.to_sym] end |
#internal_has_manies_set(name, attrs) ⇒ Object
8 9 10 11 12 |
# File 'lib/active_mongo_has_many.rb', line 8 def internal_has_manies_set(name, attrs) @@internal_has_manies ||= {} @@internal_has_manies[name.to_sym] = attrs if @@internal_has_manies[name].nil? end |