Class: BaseFormObject
- Inherits:
-
Object
- Object
- BaseFormObject
- Includes:
- ActiveModel::Attributes, ActiveModel::Model, ActiveModel::Validations::Callbacks, StripAttributes
- Defined in:
- app/forms/base_form_object.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#attributes ⇒ Object
Return symbol-keyed hash for backward compatibility with code that does attributes[:foo] or attributes.reject { |k, _| k.in?(%i[...]) }.
-
#initialize(attributes = {}) ⇒ BaseFormObject
constructor
A new instance of BaseFormObject.
- #persisted? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ BaseFormObject
Returns a new instance of BaseFormObject.
14 15 16 |
# File 'app/forms/base_form_object.rb', line 14 def initialize(attributes = {}) super end |
Instance Method Details
#attributes ⇒ Object
Return symbol-keyed hash for backward compatibility with code that does
attributes[:foo] or attributes.reject { |k, _| k.in?(%i[...]) }.
20 21 22 |
# File 'app/forms/base_form_object.rb', line 20 def attributes super.transform_keys(&:to_sym) end |
#persisted? ⇒ Boolean
10 11 12 |
# File 'app/forms/base_form_object.rb', line 10 def persisted? false end |