Class: IsoBibItem::Organization
- Inherits:
-
Contributor
- Object
- Contributor
- IsoBibItem::Organization
- Defined in:
- lib/iso_bib_item/organization.rb
Overview
Organization.
Instance Attribute Summary collapse
- #abbreviation ⇒ IsoBibItem::LocalizedString readonly
- #identifiers ⇒ Array<IsoBibItem::OrgIdentifier> readonly
- #name ⇒ IsoBibItem::LocalizedString readonly
Attributes inherited from Contributor
Instance Method Summary collapse
-
#initialize(name:, abbreviation: nil, url: nil) ⇒ Organization
constructor
A new instance of Organization.
- #to_xml(builder) ⇒ Object
Methods inherited from Contributor
Constructor Details
#initialize(name:, abbreviation: nil, url: nil) ⇒ Organization
Returns a new instance of Organization.
46 47 48 49 50 51 |
# File 'lib/iso_bib_item/organization.rb', line 46 def initialize(name:, abbreviation: nil, url: nil) super(url: url) @name = LocalizedString.new name @abbreviation = LocalizedString.new abbreviation @identifiers = [] end |
Instance Attribute Details
#abbreviation ⇒ IsoBibItem::LocalizedString (readonly)
37 38 39 |
# File 'lib/iso_bib_item/organization.rb', line 37 def abbreviation @abbreviation end |
#identifiers ⇒ Array<IsoBibItem::OrgIdentifier> (readonly)
40 41 42 |
# File 'lib/iso_bib_item/organization.rb', line 40 def identifiers @identifiers end |
#name ⇒ IsoBibItem::LocalizedString (readonly)
34 35 36 |
# File 'lib/iso_bib_item/organization.rb', line 34 def name @name end |
Instance Method Details
#to_xml(builder) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/iso_bib_item/organization.rb', line 54 def to_xml(builder) builder.organization do builder.name { |b| name.to_xml b } builder.abbreviation { |a| abbreviation.to_xml a } if abbreviation&.to_s builder.uri uri.to_s if uri identifiers.each { |identifier| identifier.to_xml builder } super end end |