Class: Brandish::Configure::Form

Inherits:
Struct
  • Object
show all
Defined in:
lib/brandish/configure/form.rb

Overview

A form used for building.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entryObject

Returns the value of attribute entry

Returns:

  • (Object)

    the current value of entry



7
8
9
# File 'lib/brandish/configure/form.rb', line 7

def entry
  @entry
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



7
8
9
# File 'lib/brandish/configure/form.rb', line 7

def format
  @format
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



7
8
9
# File 'lib/brandish/configure/form.rb', line 7

def name
  @name
end

#processorsObject

Returns the value of attribute processors

Returns:

  • (Object)

    the current value of 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.

Parameters:

  • configure (Configure)

    The configuration object for this build.

See Also:



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, options)|
    klass = processor.is_a?(::Array) ? Processor.all.fetch(processor) : processor
    klass.new(context, options)
  end

  context.process(root)
end