Class: Brandish::Configure::Form
- Inherits:
-
Struct
- Object
- Struct
- Brandish::Configure::Form
- Defined in:
- lib/brandish/configure/form.rb
Overview
A form used for building.
Instance Attribute Summary collapse
-
#entry ⇒ Object
Returns the value of attribute entry.
-
#format ⇒ Object
Returns the value of attribute format.
-
#name ⇒ Object
Returns the value of attribute name.
-
#processors ⇒ Object
Returns the value of attribute processors.
Instance Method Summary collapse
-
#build(configure) ⇒ void
Builds the form.
Instance Attribute Details
#entry ⇒ Object
Returns the value of attribute entry
7 8 9 |
# File 'lib/brandish/configure/form.rb', line 7 def entry @entry end |
#format ⇒ Object
Returns the value of attribute format
7 8 9 |
# File 'lib/brandish/configure/form.rb', line 7 def format @format end |
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/brandish/configure/form.rb', line 7 def name @name end |
#processors ⇒ Object
Returns the value of attribute processors
7 8 9 |
# File 'lib/brandish/configure/form.rb', line 7 def processors @processors end |
Instance Method Details
#build(configure) ⇒ void
This method returns an undefined value.
Builds the form. This takes a configure object, and builds the form based on that.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/brandish/configure/form.rb', line 16 def build(configure) context = Processor::Context.new(configure, self) root = configure.roots[configure.sources.find(entry)] processors.each do |(processor, )| klass = processor.is_a?(::Array) ? Processor.all.fetch(processor) : processor klass.new(context, ) end context.process(root) end |