Class: IsoBibItem::ContributionInfo
- Inherits:
-
Object
- Object
- IsoBibItem::ContributionInfo
- Defined in:
- lib/iso_bib_item/contribution_info.rb
Overview
Contribution info.
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
[IsoBibItem::Person, IsoBibItem::Organization, IsoBibItem::IsoProjectGroup].
- #role ⇒ Array<IsoBibItem::ContributorRole> readonly
Instance Method Summary collapse
-
#initialize(entity:, role: ['publisher']) ⇒ ContributionInfo
constructor
A new instance of ContributionInfo.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(entity:, role: ['publisher']) ⇒ ContributionInfo
Returns a new instance of ContributionInfo.
45 46 47 48 |
# File 'lib/iso_bib_item/contribution_info.rb', line 45 def initialize(entity:, role: ['publisher']) @entity = entity @role = role.map { |r| ContributorRole.new(*r) } end |
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns [IsoBibItem::Person, IsoBibItem::Organization,
IsoBibItem::IsoProjectGroup].
40 41 42 |
# File 'lib/iso_bib_item/contribution_info.rb', line 40 def entity @entity end |
#role ⇒ Array<IsoBibItem::ContributorRole> (readonly)
35 36 37 |
# File 'lib/iso_bib_item/contribution_info.rb', line 35 def role @role end |
Instance Method Details
#to_xml(builder) ⇒ Object
50 51 52 |
# File 'lib/iso_bib_item/contribution_info.rb', line 50 def to_xml(builder) entity.to_xml builder end |