Class: ReciteCSV::Reader::Builder

Inherits:
Module
  • Object
show all
Defined in:
lib/recite_csv/reader/builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(header_definition, &block) ⇒ Builder

Returns a new instance of Builder.



11
12
13
14
15
16
17
18
19
20
# File 'lib/recite_csv/reader/builder.rb', line 11

def initialize(header_definition, &block)
  super()

  definition = Header::Definition.dispatch(header_definition)
  @definition = definition
  @row_class = ::Class.new(Row::Base) do |klass|
    klass.include definition.build_column_methods_module
    klass.class_exec(&block) if block
  end
end