Module: Relaton::Ecma::ParserCommon
- Included in:
- DataParser, EditionParser, MementoParser, StandardParser
- Defined in:
- lib/relaton/ecma/parser_common.rb
Instance Method Summary collapse
- #contributor ⇒ Object
- #default_bib_hash ⇒ Object
- #fetch_docidentifier(id = nil) ⇒ Array<Relaton::Bib::Docidentifier>
- #fetch_doctype ⇒ Object
- #fetch_ext ⇒ Object
Instance Method Details
#contributor ⇒ Object
10 11 12 13 14 15 |
# File 'lib/relaton/ecma/parser_common.rb', line 10 def contributor orgname = Bib::TypedLocalizedString.new(content: "Ecma International", language: "en", script: "Latn") org = Bib::Organization.new name: [orgname] role = Bib::Contributor::Role.new type: "publisher" [Bib::Contributor.new(organization: org, role: [role])] end |
#default_bib_hash ⇒ Object
4 5 6 7 8 |
# File 'lib/relaton/ecma/parser_common.rb', line 4 def default_bib_hash { type: "standard", language: ["en"], script: ["Latn"], place: [Bib::Place.new(city: "Geneva")] } end |
#fetch_docidentifier(id = nil) ⇒ Array<Relaton::Bib::Docidentifier>
18 19 20 21 22 |
# File 'lib/relaton/ecma/parser_common.rb', line 18 def fetch_docidentifier(id = nil) return [] if id.nil? || id.empty? [Bib::Docidentifier.new(type: "ECMA", content: id, primary: true)] end |
#fetch_doctype ⇒ Object
28 29 30 |
# File 'lib/relaton/ecma/parser_common.rb', line 28 def fetch_doctype Bib::Doctype.new content: "document" end |
#fetch_ext ⇒ Object
24 25 26 |
# File 'lib/relaton/ecma/parser_common.rb', line 24 def fetch_ext Ext.new(doctype: fetch_doctype, flavor: "ecma") end |