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 = {}, = {}) @params = params @model = self.class.model.new(params.merge(.slice(*self.class.key))) @result = nil @errors = ErrorProxy.new .each { |key, value| instance_variable_set("@#{key}", value) } end |