lib/etl/parser/fixed_width_parser.rb in activewarehouse-etl-0.4.0 vs lib/etl/parser/fixed_width_parser.rb in activewarehouse-etl-0.5.0
- old
+ new
@@ -1,14 +1,13 @@
module ETL #:nodoc:
module Parser #:nodoc:
# Parser for fixed with files
class FixedWidthParser < ETL::Parser::Parser
- include Enumerable
-
# Initialize the parser
# * <tt>source</tt>: The source object
- def initialize(source)
+ # * <tt>options</tt>: Parser options Hash
+ def initialize(source, options={})
super
configure
end
# Return each row
@@ -41,10 +40,10 @@
fields[field] = FixedWidthField.new(options[:name], options[:start], options[:end], options[:length], options[:type])
end
end
end
- class FixedWidthField
+ class FixedWidthField #:nodoc:
attr_reader :name, :field_start, :field_end, :field_length, :type
def initialize(name, field_start, field_end=nil, field_length=nil, type=nil)
@name = name
@type = type ||= :string
@field_start = field_start - 1
\ No newline at end of file