Sha256: 47854eceb1b804a34d1173090aceb777e3ec712b0e72ff85c8ba61fde5e519b6
Contents?: true
Size: 801 Bytes
Versions: 3
Compression:
Stored size: 801 Bytes
Contents
class Reform::Form module DSL def self.included(base) base.class_eval do extend ClassMethods end end module ClassMethods def property(name, *args) representer_class.property(name, *args) end def properties(names, *args) names.each do |name| property(name, *args) end end #private def representer_class @representer_class ||= Class.new(Reform::Representer) end def model_class rpr = representer_class @model_class ||= Class.new(Reform::Composition) do map_from rpr end end end def initialize(models) composition = self.class.model_class.new(models) super(self.class.representer_class, composition) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
reform-0.1.2 | lib/reform/form/dsl.rb |
reform-0.1.1 | lib/reform/form/dsl.rb |
reform-0.1.0 | lib/reform/form/dsl.rb |