Sha256: 235b695a430c2fa24e083f997fcc5d44e314b17f00f739628725eb5bb60eef25

Contents?: true

Size: 1.01 KB

Versions: 27

Compression:

Stored size: 1.01 KB

Contents

module RelatonIec
  class ErefType < RelatonIec::CitationType
    # @return [String]
    attr_reader :citeas

    # @return [RelatonIec::ReferenceFormat]
    attr_reader :type

    # @return [Boolean, nil]
    attr_reader :normative

    # @return [String, nil]
    attr_reader :alt

    # @param [String] citeas
    # @param [RelatonIec::ReferenceFormat] type
    # @param [Hash] args
    # @option args [Boolean, nil] :normative
    # @option args [String, nil] :alt
    def initialize(citeas:, type:, bibitemid:, locality:, **args)
      super bibitemid, locality, args[:date]
      @citeas = citeas
      @type = type
      @normative = args[:normative]
      @alt = args[:alt]
    end

    #
    # @param [Nokogiri::XML::Builder] builder <description>
    #
    def to_xml(builder) # rubocop:disable Metrics/AbcSize
      builder.parent[:normative] = normative unless normative.nil?
      builder.parent[:citeas] = citeas
      builder.parent[:type] = type
      builder.parent[:alt] = alt if alt
      super
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
relaton-iec-1.20.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.19.1 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.19.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.18.1 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.18.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.17.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.16.4 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.16.3 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.16.2 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.16.1 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.16.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.14.4 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.14.3 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.14.2 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.14.1 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.14.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.13.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.12.0 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.11.4 lib/relaton_iec/basic_block/eref_type.rb
relaton-iec-1.11.3 lib/relaton_iec/basic_block/eref_type.rb