Class: Relaton::Ecma::DataParser

Inherits:
Object
  • Object
show all
Includes:
ParserCommon
Defined in:
lib/relaton/ecma/data_parser.rb

Instance Method Summary collapse

Methods included from ParserCommon

#contributor, #default_bib_hash, #fetch_docidentifier, #fetch_doctype, #fetch_ext

Constructor Details

#initialize(hit, errors = {}) ⇒ DataParser

Initialize parser

Parameters:

  • hit (Nokogiri::XML::Element)

    document hit

  • errors (Hash) (defaults to: {})

    error tracking hash



12
13
14
15
# File 'lib/relaton/ecma/data_parser.rb', line 12

def initialize(hit, errors = {})
  @hit = hit
  @errors = errors
end

Instance Method Details

#parseArray<Relaton::Ecma::ItemData>

Returns:



18
19
20
21
22
23
24
# File 'lib/relaton/ecma/data_parser.rb', line 18

def parse
  if @hit[:href]
    parse_standard
  else
    parse_memento
  end
end