Class: DarwinCore::Core
- Inherits:
-
Object
- Object
- DarwinCore::Core
- Includes:
- Ingester
- Defined in:
- lib/dwc_archive/core.rb
Overview
Represents core of the DarwinCore Archive
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes included from Ingester
#data, #encoding, #fields, #fields_separator, #file_path, #ignore_headers, #line_separator, #properties, #quote_character, #size
Instance Method Summary collapse
-
#initialize(dwc) ⇒ Core
constructor
rubocop:disable Metrics/MethodLength.
Methods included from Ingester
Constructor Details
#initialize(dwc) ⇒ Core
rubocop:disable Metrics/MethodLength
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dwc_archive/core.rb', line 10 def initialize(dwc) @dwc = dwc @archive = @dwc.archive @path = @archive.files_path root_key = @archive..keys[0] @data = @archive.[root_key][:core] unless @data raise DarwinCore::CoreFileError, "Cannot find core in meta.xml, is meta.xml valid?" end @id = @data[:id][:attributes] init_attributes end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/dwc_archive/core.rb', line 7 def id @id end |