Method: Ethel::Sources::CSV#initialize

Defined in:
lib/ethel/sources/csv.rb

#initialize(options = {}) ⇒ CSV

Returns a new instance of CSV.



4
5
6
7
8
9
10
# File 'lib/ethel/sources/csv.rb', line 4

def initialize(options = {})
  if options[:string]
    @data = ::CSV.parse(options[:string], :headers => true)
  elsif options[:file]
    @data = ::CSV.read(options[:file], :headers => true)
  end
end