Class: Csv2hash::Adapter::CsvAdapter

Inherits:
Abstract
  • Object
show all
Defined in:
lib/csv2hash/adapters/csv_adapter.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (CsvAdapter) initialize(file_path)

Returns a new instance of CsvAdapter



11
12
13
# File 'lib/csv2hash/adapters/csv_adapter.rb', line 11

def initialize file_path
  self.file_path = file_path
end

Instance Attribute Details

- (Object) file_path

Returns the value of attribute file_path



9
10
11
# File 'lib/csv2hash/adapters/csv_adapter.rb', line 9

def file_path
  @file_path
end

Instance Method Details

- (Object) source



15
16
17
# File 'lib/csv2hash/adapters/csv_adapter.rb', line 15

def source
  CSV.read self.file_path
end