Class: Id::Form::ActiveModelForm

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::Conversion, ActiveModel::Validations
Defined in:
lib/id/form/active_model_form.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ ActiveModelForm

Returns a new instance of ActiveModelForm.



12
13
14
# File 'lib/id/form/active_model_form.rb', line 12

def initialize(model)
  @model = model
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)



26
27
28
# File 'lib/id/form/active_model_form.rb', line 26

def method_missing(name, *args, &block)
  model.send(name, *args, &block)
end

Class Method Details

.i18n_scopeObject



8
9
10
# File 'lib/id/form/active_model_form.rb', line 8

def self.i18n_scope
  :id
end

Instance Method Details

#persisted?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/id/form/active_model_form.rb', line 16

def persisted?
  false
end

#to_modelObject



20
21
22
# File 'lib/id/form/active_model_form.rb', line 20

def to_model
  self
end