Class: DarwinCore::Core
- Inherits:
-
Object
- Object
- DarwinCore::Core
- Includes:
- Ingester
- Defined in:
- lib/dwc-archive/core.rb
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
A new instance of Core.
Methods included from Ingester
Constructor Details
#initialize(dwc) ⇒ Core
Returns a new instance of Core.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/dwc-archive/core.rb', line 5 def initialize(dwc) @dwc = dwc @archive = @dwc.archive @path = @archive.files_path root_key = @archive..keys[0] @data = @archive.[root_key][:core] raise DarwinCore::CoreFileError.new("Cannot find core in meta.xml, is meta.xml valid?") unless @data @id = @data[:id][:attributes] # raise DarwinCore::CoreFileError.new("Cannot find core identifier") unless @id get_attributes(DarwinCore::CoreFileError) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/dwc-archive/core.rb', line 4 def id @id end |