Module: ActiveModel::Model
- Included in:
- ForgedModel::Model
- Defined in:
- lib/active_model/model.rb
Class Method Summary collapse
-
.included(base) ⇒ Object
:nodoc:.
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
:nodoc:
4 5 6 7 8 9 10 11 |
# File 'lib/active_model/model.rb', line 4 def self.included(base) #:nodoc: base.class_eval do extend ActiveModel::Naming extend ActiveModel::Translation include ActiveModel::Validations include ActiveModel::Conversion end end |
Instance Method Details
#initialize(params = {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/active_model/model.rb', line 13 def initialize(params={}) params.each do |attr, value| self.public_send("#{attr}=", value) end if params super() end |
#persisted? ⇒ Boolean
20 21 22 |
# File 'lib/active_model/model.rb', line 20 def persisted? false end |