Module: RelatonIetf::BibXMLParser

Extended by:
BibXMLParser
Includes:
RelatonBib::BibXMLParser
Included in:
BibXMLParser
Defined in:
lib/relaton_ietf/bibxml_parser.rb

Instance Method Summary collapse

Instance Method Details

#bib_item(**attrs) ⇒ RelatonIetf::IetfBibliographicItem

Parameters:

  • attrs (Hash)

Returns:



8
9
10
11
12
13
14
# File 'lib/relaton_ietf/bibxml_parser.rb', line 8

def bib_item(**attrs)
  unless attrs.delete(:is_relation)
    attrs[:fetched] = Date.today.to_s
    # attrs[:place] = ["Fremont, CA"]
  end
  RelatonIetf::IetfBibliographicItem.new(**attrs)
end

#committee(wgr) ⇒ RelatonIetf::Committee

Parameters:

  • (RelatonBib::WorkGroup)

Returns:



33
34
35
# File 'lib/relaton_ietf/bibxml_parser.rb', line 33

def committee(wgr)
  Committee.new wgr
end

#contributors(reference) ⇒ Array<Hash>

Parameters:

  • reference (Nokogiri::XML::Element)

Returns:

  • (Array<Hash>)


39
40
41
42
43
44
45
# File 'lib/relaton_ietf/bibxml_parser.rb', line 39

def contributors(reference)
  [{
    entity: new_org("Internet Engineering Task Force", "IETF"),
    role: [type: "publisher"],
  }] + super
  # persons(reference) + organizations(reference)
end

#pubid_type(id) ⇒ String

Extract document identifier type form identifier

Parameters:

  • id (String)

    identifier

Returns:

  • (String)

    type



23
24
25
26
27
28
29
# File 'lib/relaton_ietf/bibxml_parser.rb', line 23

def pubid_type(id)
  type = super
  case type
  when "BCP", "FYI", "STD", "RFC" then "RFC"
  else "IETF"
  end
end