Sha256: 90e05e09ae5e4f462a018e19cee1a4070c24b6e4b753987ec563f8547805c16b

Contents?: true

Size: 1.25 KB

Versions: 24

Compression:

Stored size: 1.25 KB

Contents

module RelatonIetf
  module BibXMLParser
    include RelatonBib::BibXMLParser
    extend BibXMLParser

    # @param attrs [Hash]
    # @return [RelatonIetf::IetfBibliographicItem]
    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

    #
    # Extract document identifier type form identifier
    #
    # @param [String] id identifier
    #
    # @return [String] type
    #
    def pubid_type(id)
      type = super
      case type
      when "BCP", "FYI", "STD", "RFC" then "RFC"
      when "Internet-Draft" then type
      else "IETF"
      end
    end

    # @param [RelatonBib::WorkGroup]
    # @return [RelatonIetf::Committee]
    def committee(wgr)
      Committee.new wgr
    end

    # @param reference [Nokogiri::XML::Element]
    # @return [Array<Hash>]
    def contributors(reference)
      contribs = []
      unless reference[:anchor]&.match?(/^I-D/)
        contribs << {
          entity: new_org("Internet Engineering Task Force", "IETF"),
          role: [type: "publisher"],
        }
      end
      contribs + super
      # persons(reference) + organizations(reference)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
relaton-ietf-1.13.1 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.13.0 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.11 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.10 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.9 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.8 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.7 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.6 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.5 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.4 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.3 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.2 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.1 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.12.0 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.11.6 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.11.5 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.11.4 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.11.3 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.11.2 lib/relaton_ietf/bibxml_parser.rb
relaton-ietf-1.11.1 lib/relaton_ietf/bibxml_parser.rb