Class: DarwinCore::Core

Inherits:
Object
  • Object
show all
Includes:
Ingester
Defined in:
lib/dwc_archive/core.rb

Overview

Represents core of the DarwinCore Archive

Instance Attribute Summary collapse

Attributes included from Ingester

#data, #encoding, #fields, #fields_separator, #file_path, #ignore_headers, #line_separator, #properties, #quote_character, #size

Instance Method Summary collapse

Methods included from Ingester

#read

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.meta.keys[0]
  @data = @archive.meta[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

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/dwc_archive/core.rb', line 7

def id
  @id
end