Sha256: 1449514862d28c5fad3ce2bf57c8ccf78b5d20f101262efc2e884c0eb03819f6

Contents?: true

Size: 871 Bytes

Versions: 8

Compression:

Stored size: 871 Bytes

Contents

module RelatonIetf
  class IetfBibliographicItem < RelatonBib::BibliographicItem
    DOCTYPES = %w[rfc internet-draft].freeze

    # @return [String, NilClass]
    attr_reader :doctype

    # @return [Array<String>]
    attr_reader :keyword

    # @param doctype [String]
    # @param keyword [Array<String>]
    def initialize(**args)
      if args[:doctype] && !DOCTYPES.include?(args[:doctype])
        warn "[relaton-ietf] WARNING: invalid doctype #{args[:doctype]}"
      end
      super
    end

    # @param opts [Hash]
    # @option opts [Nokogiri::XML::Builder] :builder XML builder
    # @option opts [Boolean] :bibdata
    # @option opts [Symbol, NilClass] :date_format (:short), :full
    # @option opts [String, Symbol] :lang language
    # @return [String] XML
    def to_xml(**opts)
      opts[:date_format] ||= :short
      super **opts
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
relaton-ietf-1.7.3 lib/relaton_ietf/ietf_bibliographic_item.rb
relaton-ietf-1.7.2 lib/relaton_ietf/ietf_bibliographic_item.rb
relaton-ietf-1.7.1 lib/relaton_ietf/ietf_bibliographic_item.rb
relaton-ietf-1.7.0 lib/relaton_ietf/ietf_bibliographic_item.rb
relaton-ietf-1.6.0 lib/relaton_ietf/ietf_bibliographic_item.rb
relaton-ietf-1.6.pre1 lib/relaton_ietf/ietf_bibliographic_item.rb
relaton-ietf-1.5.0 lib/relaton_ietf/ietf_bibliographic_item.rb
relaton-ietf-1.5.pre lib/relaton_ietf/ietf_bibliographic_item.rb