Class: Ddr::IngestTools::DdrRdrMigrator::ManifestParser
- Inherits:
-
Object
- Object
- Ddr::IngestTools::DdrRdrMigrator::ManifestParser
- Defined in:
- lib/ddr/ingesttools/ddr_rdr_migrator/manifest_parser.rb
Instance Attribute Summary collapse
-
#manifest_file_path ⇒ Object
readonly
Returns the value of attribute manifest_file_path.
Instance Method Summary collapse
- #as_csv_table ⇒ Object
- #headers ⇒ Object
-
#initialize(manifest_file_path) ⇒ ManifestParser
constructor
A new instance of ManifestParser.
Constructor Details
#initialize(manifest_file_path) ⇒ ManifestParser
Returns a new instance of ManifestParser.
8 9 10 |
# File 'lib/ddr/ingesttools/ddr_rdr_migrator/manifest_parser.rb', line 8 def initialize(manifest_file_path) @manifest_file_path = manifest_file_path end |
Instance Attribute Details
#manifest_file_path ⇒ Object (readonly)
Returns the value of attribute manifest_file_path.
6 7 8 |
# File 'lib/ddr/ingesttools/ddr_rdr_migrator/manifest_parser.rb', line 6 def manifest_file_path @manifest_file_path end |
Instance Method Details
#as_csv_table ⇒ Object
12 13 14 |
# File 'lib/ddr/ingesttools/ddr_rdr_migrator/manifest_parser.rb', line 12 def as_csv_table @csv_table ||= CSV.read(manifest_file_path, headers: true) end |
#headers ⇒ Object
16 17 18 |
# File 'lib/ddr/ingesttools/ddr_rdr_migrator/manifest_parser.rb', line 16 def headers as_csv_table.headers end |