Module: MongoLight::EmbeddedDocument::InstanceMethods
- Defined in:
- lib/mongo_light/embedded_document.rb
Instance Method Summary collapse
Instance Method Details
#[](name) ⇒ Object
82 83 84 |
# File 'lib/mongo_light/embedded_document.rb', line 82 def [](name) @attributes[name] end |
#attributes ⇒ Object
85 86 87 |
# File 'lib/mongo_light/embedded_document.rb', line 85 def attributes @attributes end |
#initialize(attributes = {}) ⇒ Object
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mongo_light/embedded_document.rb', line 72 def initialize(attributes = {}) @attributes = {} attributes.each do |k,v| if self.class.map_include?(k) @attributes[k] = v else send("#{k}=", v) end end end |