Module: Fleakr::Support::Object::InstanceMethods
- Defined in:
- lib/fleakr/support/object.rb
Instance Method Summary collapse
Instance Method Details
#initialize(document = nil) ⇒ Object
91 92 93 |
# File 'lib/fleakr/support/object.rb', line 91 def initialize(document = nil) self.populate_from(document) unless document.nil? end |
#populate_from(document) ⇒ Object
95 96 97 98 99 100 |
# File 'lib/fleakr/support/object.rb', line 95 def populate_from(document) self.class.attributes.each do |attribute| value = attribute.value_from(document) self.send("#{attribute.name}=".to_sym, value) unless value.nil? end end |