Class: Csv2hash::Adapter::CsvAdapter
- Defined in:
- lib/csv2hash/adapters/csv_adapter.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
Returns the value of attribute file_path.
Instance Method Summary collapse
-
#initialize(file_path) ⇒ CsvAdapter
constructor
A new instance of CsvAdapter.
- #source ⇒ Object
Constructor Details
#initialize(file_path) ⇒ CsvAdapter
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
#file_path ⇒ Object
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
#source ⇒ Object
15 16 17 18 |
# File 'lib/csv2hash/adapters/csv_adapter.rb', line 15 def source check_file! CSV.read self.file_path end |