Class: RelatonIec::ErefType

Inherits:
CitationType show all
Defined in:
lib/relaton_iec/basic_block/eref_type.rb

Direct Known Subclasses

Eref

Instance Attribute Summary collapse

Attributes inherited from CitationType

#bibitemid, #date, #locality

Instance Method Summary collapse

Constructor Details

#initialize(citeas:, type:, bibitemid:, locality:, **args) ⇒ ErefType

Returns a new instance of ErefType.

Parameters:

Options Hash (**args):

  • :normative (Boolean, nil)
  • :alt (String, nil)


20
21
22
23
24
25
26
# File 'lib/relaton_iec/basic_block/eref_type.rb', line 20

def initialize(citeas:, type:, bibitemid:, locality:, **args)
  super bibitemid, locality, args[:date]
  @citeas = citeas
  @type = type
  @normative = args[:normative]
  @alt = args[:alt]
end

Instance Attribute Details

#altString? (readonly)

Returns:

  • (String, nil)


13
14
15
# File 'lib/relaton_iec/basic_block/eref_type.rb', line 13

def alt
  @alt
end

#citeasString (readonly)

Returns:

  • (String)


4
5
6
# File 'lib/relaton_iec/basic_block/eref_type.rb', line 4

def citeas
  @citeas
end

#normativeBoolean? (readonly)

Returns:

  • (Boolean, nil)


10
11
12
# File 'lib/relaton_iec/basic_block/eref_type.rb', line 10

def normative
  @normative
end

#typeRelatonIec::ReferenceFormat (readonly)



7
8
9
# File 'lib/relaton_iec/basic_block/eref_type.rb', line 7

def type
  @type
end

Instance Method Details

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)

    <description>



31
32
33
34
35
36
37
# File 'lib/relaton_iec/basic_block/eref_type.rb', line 31

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