Class: RelatonBib::Classification

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton_bib/classification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, value:) ⇒ Classification

Returns a new instance of Classification.

Parameters:

  • type (String, NilClass) (defaults to: nil)
  • value (String)


22
23
24
25
# File 'lib/relaton_bib/classification.rb', line 22

def initialize(type: nil, value:)
  @type  = type
  @value = value
end

Instance Attribute Details

#typeString, NilClass (readonly)

Returns:

  • (String, NilClass)


15
16
17
# File 'lib/relaton_bib/classification.rb', line 15

def type
  @type
end

#valueString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/relaton_bib/classification.rb', line 18

def value
  @value
end

Instance Method Details

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


28
29
30
31
# File 'lib/relaton_bib/classification.rb', line 28

def to_xml(builder)
  xml = builder.classification value
  xml[:type] = type if type
end