Class: LeanModel::Base
- Inherits:
-
Object
- Object
- LeanModel::Base
- Extended by:
- ActiveModel::Naming, ActiveModel::Translation
- Includes:
- ActiveModel::AttributeMethods, ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- lib/lean_model/base.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.attributes(*names) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/lean_model/base.rb', line 17 def self.attributes(*names) attr_accessor *names define_attribute_methods names self._attributes += names end |
Instance Method Details
#attributes ⇒ Object
24 25 26 27 28 29 |
# File 'lib/lean_model/base.rb', line 24 def attributes self._attributes.inject({}) do |hash,attr| hash[attr.to_s] = send(attr) hash end end |
#persisted? ⇒ Boolean
31 32 33 |
# File 'lib/lean_model/base.rb', line 31 def persisted? false end |