class FixedWidthGenerator::Definition
Attributes
options[R]
sections[R]
templates[R]
Public Class Methods
new(options={})
click to toggle source
# File lib/aba_generator/fixed_width/definition.rb, line 5 def initialize(options={}) @sections = [] @templates = {} @options = { :align => :right }.merge(options) end
Public Instance Methods
method_missing(method, *args, &block)
click to toggle source
# File lib/aba_generator/fixed_width/definition.rb, line 27 def method_missing(method, *args, &block) section(method, *args, &block) end
section(name, options={}) { |section| ... }
click to toggle source
# File lib/aba_generator/fixed_width/definition.rb, line 11 def section(name, options={}, &block) raise DuplicateSectionNameError.new("Duplicate section name: '#{name}'") if @sections.detect{|s| s.name == name } section = FixedWidthGenerator::Section.new(name, @options.merge(options)) section.definition = self yield(section) @sections << section section end
template(name, options={}) { |section| ... }
click to toggle source
# File lib/aba_generator/fixed_width/definition.rb, line 21 def template(name, options={}, &block) section = FixedWidthGenerator::Section.new(name, @options.merge(options)) yield(section) @templates[name] = section end