Class: RelatonIsoBib::IsoSubgroup
- Inherits:
-
Object
- Object
- RelatonIsoBib::IsoSubgroup
- Defined in:
- lib/relaton_iso_bib/editorial_group.rb
Overview
ISO subgroup.
Instance Attribute Summary collapse
- #name ⇒ String readonly
- #number ⇒ Integer, NilClass readonly
- #type ⇒ String, NilClass readonly
Instance Method Summary collapse
-
#initialize(name:, type: nil, number: nil) ⇒ IsoSubgroup
constructor
A new instance of IsoSubgroup.
- #to_hash ⇒ Hash
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(name:, type: nil, number: nil) ⇒ IsoSubgroup
Returns a new instance of IsoSubgroup.
94 95 96 97 98 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 94 def initialize(name:, type: nil, number: nil) @name = name @type = type @number = number end |
Instance Attribute Details
#name ⇒ String (readonly)
89 90 91 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 89 def name @name end |
#number ⇒ Integer, NilClass (readonly)
86 87 88 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 86 def number @number end |
#type ⇒ String, NilClass (readonly)
83 84 85 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 83 def type @type end |
Instance Method Details
#to_hash ⇒ Hash
108 109 110 111 112 113 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 108 def to_hash hash = { "name" => name } hash["type"] = type if type hash["number"] = number if number hash end |
#to_xml(builder) ⇒ Object
101 102 103 104 105 |
# File 'lib/relaton_iso_bib/editorial_group.rb', line 101 def to_xml(builder) builder.parent[:number] = number if number builder.parent[:type] = type if type builder.text name end |