Class: RelatonIetf::Renderer::BibXML

Inherits:
RelatonBib::Renderer::BibXML
  • Object
show all
Defined in:
lib/relaton_ietf/renderer/bibxml.rb

Instance Method Summary collapse

Instance Method Details

#render_authors(builder) ⇒ Object

Render authors as BibXML. Override to skip “RFC Publisher” organization.

Parameters:

  • builder (Nokogiri::XML::Builder)

    xml builder



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/relaton_ietf/renderer/bibxml.rb', line 18

def render_authors(builder) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
  @bib.contributor.each do |c|
    next if c.entity.is_a?(RelatonBib::Organization) && c.entity.name.map(&:content).include?("RFC Publisher")

    builder.author do |xml|
      xml.parent[:role] = "editor" if c.role.detect { |r| r.type == "editor" }
      if c.entity.is_a?(RelatonBib::Person) then render_person xml, c.entity
      else render_organization xml, c.entity, c.role
      end
      render_address xml, c
    end
  end
end

#render_date(builder) ⇒ Object

Render dates as BibXML. Override to skip IANA date rendering.

Parameters:

  • builder (Nokogiri::XML::Builder)

    xml builder



9
10
11
# File 'lib/relaton_ietf/renderer/bibxml.rb', line 9

def render_date(builder)
  super unless @bib.docidentifier.detect { |i| i.type == "IANA" }
end