Class: BaseFormObject

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Attributes, ActiveModel::Model, ActiveModel::Validations::Callbacks, StripAttributes
Defined in:
app/forms/base_form_object.rb

Overview

Form object: base form object.

Direct Known Subclasses

Image::Transform, Lead

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BaseFormObject

Returns a new instance of BaseFormObject.



16
17
18
# File 'app/forms/base_form_object.rb', line 16

def initialize(attributes = {})
  super
end

Instance Method Details

#attributesObject

Return symbol-keyed hash for backward compatibility with code that does
attributes[:foo] or attributes.reject { |k, _| k.in?(%i[...]) }.



22
23
24
# File 'app/forms/base_form_object.rb', line 22

def attributes
  super.transform_keys(&:to_sym)
end

#persisted?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/forms/base_form_object.rb', line 12

def persisted?
  false
end