Class: Height::Model::Base
- Inherits:
-
Object
- Object
- Height::Model::Base
- Defined in:
- lib/height/model/base.rb
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attrs) ⇒ Base
Returns a new instance of Base.
3 4 5 6 7 8 9 10 |
# File 'lib/height/model/base.rb', line 3 def initialize(attrs) self.attributes.each do |key| self.instance_variable_set("@#{key}", attrs[key.to_s]) define_singleton_method(key) do self.instance_variable_get("@#{key}") end end end |