Class: Attrocity::Model
- Inherits:
-
Object
- Object
- Attrocity::Model
- Defined in:
- lib/attrocity/model.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Model
constructor
A new instance of Model.
Constructor Details
#initialize(attributes) ⇒ Model
Returns a new instance of Model.
3 4 5 6 7 8 |
# File 'lib/attrocity/model.rb', line 3 def initialize(attributes) attributes.each do |k,v| self.define_singleton_method(k) { v } self.define_singleton_method("#{k}?") { !!v } end end |