Module: Reform::Form::Module::Included

Defined in:
lib/reform/form/module.rb

Overview

TODO: use representable’s inheritance mechanism.

Instance Method Summary collapse

Instance Method Details

#included(base) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/reform/form/module.rb', line 9

def included(base)
  super
  instructions.each { |cfg|
    args    = cfg[1].dup
    options = args.extract_options!.dup # we need to duplicate options has as AM::Validations messes it up later.

    base.send(cfg[0], *args, options, &cfg[2]) } # property :name, {} do .. end
end