Method: FormObject::Base#as_json
- Defined in:
- lib/form_object/base.rb
#as_json ⇒ Object
This method is used to turn the attributes of the form into a stringified object that resembles json
275 276 277 278 279 |
# File 'lib/form_object/base.rb', line 275 def as_json instance_variables.each_with_object({}) do |var, obj| obj[var.to_s.gsub('@','')] = instance_variable_get(var) end.stringify_keys end |