Sha256: 0e6435eaab8900358b28fa3d6e841ed4f79fd5b0cd87346f2193a8bc35948085
Contents?: true
Size: 510 Bytes
Versions: 7
Compression:
Stored size: 510 Bytes
Contents
module PR class BuildModel def self.[] form, model new(PR::FieldRegistry[form.class]).for form, model end def initialize registry @registry = registry end def for form, model @registry.fields.each do |field_name| set model, field_name, value(form, field_name) end end private def set thing, name, value thing.send "#{name}=", value end def value thing, name thing.send("__#{name}").convert end end end
Version data entries
7 entries across 7 versions & 1 rubygems