Class: Reform::Representer

Inherits:
Representable::Decorator
  • Object
show all
Includes:
Representable::Hash
Defined in:
lib/reform/representer.rb

Defined Under Namespace

Modules: WithOptions

Instance Method Summary collapse

Instance Method Details

#fieldsObject

Returns hash of all property names.



39
40
41
# File 'lib/reform/representer.rb', line 39

def fields
  representable_attrs.map(&:name)
end

#nested_forms(&block) ⇒ Object



43
44
45
46
47
48
# File 'lib/reform/representer.rb', line 43

def nested_forms(&block)
  clone_config!.
    find_all { |attr| attr.options[:form] }.
    collect  { |attr| [attr, represented.send(attr.getter)] }. # DISCUSS: can't we do this with the Binding itself?
    each(&block)
end