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
10 11 12 |
# File 'lib/brandish/configure/form.rb', line 10 def entry @entry end |
#format ⇒ Object
Returns the value of attribute format
10 11 12 |
# File 'lib/brandish/configure/form.rb', line 10 def format @format end |
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/brandish/configure/form.rb', line 10 def name @name end |
#processors ⇒ Object
Returns the value of attribute processors
10 11 12 |
# File 'lib/brandish/configure/form.rb', line 10 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.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/brandish/configure/form.rb', line 19 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 |