Class: Reform::Expose

Inherits:
Object
  • Object
show all
Includes:
Disposable::Composition
Defined in:
lib/reform/composition.rb

Direct Known Subclasses

Composition

Class Method Summary collapse

Class Method Details

.from(representer) ⇒ Object

Builder for a concrete Composition class with configurations from the form’s representer.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/reform/composition.rb', line 11

def from(representer)
  options = {}

  representer.representable_attrs.each do |definition|
    process_definition!(options, definition)
  end

  Class.new(self).tap do |composition| # for 1.8 compat. you're welcome.
    composition.map(options)
    # puts [email protected]
  end
end