Class: SeparatedValues::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/separated_values/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path, options = DEFAULT_OPTIONS) ⇒ Parser

Returns a new instance of Parser.



8
9
10
11
# File 'lib/separated_values/parser.rb', line 8

def initialize(file_path, options = DEFAULT_OPTIONS)
  @file_path = file_path
  @options = options
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



6
7
8
# File 'lib/separated_values/parser.rb', line 6

def file_path
  @file_path
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/separated_values/parser.rb', line 6

def options
  @options
end

Instance Method Details

#parseObject



13
14
15
# File 'lib/separated_values/parser.rb', line 13

def parse
  Document.new(rows, options)
end