class DataFile::Reader

Attributes

file[R]
file_path[R]
options[R]

Public Class Methods

new(file_path, options = {}) click to toggle source
# File lib/data_file/reader.rb, line 7
def initialize(file_path, options = {})
  @options = { headers: true }.merge(options) 
  @file_path = file_path
end

Public Instance Methods

detector() click to toggle source
# File lib/data_file/reader.rb, line 20
def detector
  @detector ||= Detector.new(file)
end
parser() click to toggle source
# File lib/data_file/reader.rb, line 16
def parser
  @parser ||= detector.text? ? CSV.new(self) : Excel.new(self)
end