Sha256: cd2cbcacd7e9b9c3ef1308241ae77f3e5bbd5feba18571006eaddd91a649e9a3
Contents?: true
Size: 895 Bytes
Versions: 1
Compression:
Stored size: 895 Bytes
Contents
class FixedWidthGenerator class Definition attr_reader :sections, :templates, :options def initialize(options={}) @sections = [] @templates = {} @options = { :align => :right }.merge(options) end 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 def template(name, options={}, &block) section = FixedWidthGenerator::Section.new(name, @options.merge(options)) yield(section) @templates[name] = section end def method_missing(method, *args, &block) section(method, *args, &block) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aba_generator-1.0.0 | lib/aba_generator/fixed_width/definition.rb |