Class: Relaton::Ecma::MementoParser
- Inherits:
-
Object
- Object
- Relaton::Ecma::MementoParser
- Includes:
- ParserCommon
- Defined in:
- lib/relaton/ecma/memento_parser.rb
Constant Summary collapse
- ATTRS =
%i[docidentifier title date source ext].freeze
Instance Method Summary collapse
-
#initialize(hit:, errors: {}) ⇒ MementoParser
constructor
A new instance of MementoParser.
-
#to_bib_hash ⇒ Hash
Bibliographic item attributes.
Methods included from ParserCommon
#contributor, #default_bib_hash, #fetch_doctype, #fetch_ext
Constructor Details
#initialize(hit:, errors: {}) ⇒ MementoParser
Returns a new instance of MementoParser.
10 11 12 13 |
# File 'lib/relaton/ecma/memento_parser.rb', line 10 def initialize(hit:, errors: {}) @hit = hit @errors = errors end |
Instance Method Details
#to_bib_hash ⇒ Hash
Returns bibliographic item attributes.
16 17 18 19 20 |
# File 'lib/relaton/ecma/memento_parser.rb', line 16 def to_bib_hash bib = default_bib_hash ATTRS.each { |a| bib[a] = send "fetch_#{a}" } bib end |