Class: Edifice::FormModel
- Inherits:
-
Object
- Object
- Edifice::FormModel
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- lib/edifice/form_model.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ FormModel
constructor
A new instance of FormModel.
- #persisted? ⇒ Boolean
-
#save ⇒ Object
default implementation, override as necessary.
Constructor Details
#initialize(attributes = {}) ⇒ FormModel
9 10 11 |
# File 'lib/edifice/form_model.rb', line 9 def initialize(attributes = {}) attributes.each { |n, v| send("#{n}=", v) if respond_to?("#{n}=") } end |
Class Method Details
.create(attributes = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/edifice/form_model.rb', line 18 def self.create(attributes = {}) form = new(attributes) form.save form end |
Instance Method Details
#persisted? ⇒ Boolean
24 25 26 |
# File 'lib/edifice/form_model.rb', line 24 def persisted? false end |
#save ⇒ Object
default implementation, override as necessary
14 15 16 |
# File 'lib/edifice/form_model.rb', line 14 def save valid? end |