Class: Hyrax::Ingest::Fetcher::CSVFile
- Includes:
- HasIteration, HasSIP
- Defined in:
- lib/hyrax/ingest/fetcher/csv_file.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#header_row_number ⇒ Object
readonly
Returns the value of attribute header_row_number.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(options = {}) ⇒ CSVFile
constructor
A new instance of CSVFile.
Methods included from HasIteration
Methods included from HasSIP
Methods inherited from Base
Methods included from HasLogger
Methods included from HasReport
Constructor Details
#initialize(options = {}) ⇒ CSVFile
Returns a new instance of CSVFile.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/hyrax/ingest/fetcher/csv_file.rb', line 15 def initialize(={}) raise ArgumentError, "Required option :filename is missing" unless .key?(:filename) raise ArgumentError, "Required option :column is missing" unless .key?(:column) raise ArgumentError, "Required option :row is missing" unless .key?(:row) @filename = .fetch(:filename) @column = .fetch(:column, '').to_s.strip.downcase @row = .fetch(:row, '').to_s.strip.downcase @header_row_number = .fetch(:header_row_number, 1) @row_offset = [:row_offset] super end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
10 11 12 |
# File 'lib/hyrax/ingest/fetcher/csv_file.rb', line 10 def column @column end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
10 11 12 |
# File 'lib/hyrax/ingest/fetcher/csv_file.rb', line 10 def filename @filename end |
#header_row_number ⇒ Object (readonly)
Returns the value of attribute header_row_number.
10 11 12 |
# File 'lib/hyrax/ingest/fetcher/csv_file.rb', line 10 def header_row_number @header_row_number end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
10 11 12 |
# File 'lib/hyrax/ingest/fetcher/csv_file.rb', line 10 def row @row end |
Instance Method Details
#fetch ⇒ Object
28 29 30 |
# File 'lib/hyrax/ingest/fetcher/csv_file.rb', line 28 def fetch @fetched_value ||= cell_value end |