Method: ROM::Model::Form#initialize

Defined in:
lib/rom/rails/model/form.rb

#initialize(params = {}, options = {}) ⇒ Form

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Form.



91
92
93
94
95
96
97
# File 'lib/rom/rails/model/form.rb', line 91

def initialize(params = {}, options = {})
  @params = params
  @model  = self.class.model.new(params.merge(options.slice(*self.class.key)))
  @result = nil
  @errors = ErrorProxy.new
  options.each { |key, value| instance_variable_set("@#{key}", value) }
end