Class: RelatonBib::ContributionInfo
- Inherits:
-
Object
- Object
- RelatonBib::ContributionInfo
- Defined in:
- lib/relaton_bib/contribution_info.rb
Overview
Contribution info.
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
[RelatonBib::Person, RelatonBib::Organization].
- #role ⇒ Array<RelatonBib::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.
65 66 67 68 |
# File 'lib/relaton_bib/contribution_info.rb', line 65 def initialize(entity:, role: ["publisher"]) @entity = entity @role = role.map { |r| ContributorRole.new(*r) } end |
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns [RelatonBib::Person, RelatonBib::Organization].
61 62 63 |
# File 'lib/relaton_bib/contribution_info.rb', line 61 def entity @entity end |
#role ⇒ Array<RelatonBib::ContributorRole> (readonly)
57 58 59 |
# File 'lib/relaton_bib/contribution_info.rb', line 57 def role @role end |
Instance Method Details
#to_xml(builder) ⇒ Object
70 71 72 |
# File 'lib/relaton_bib/contribution_info.rb', line 70 def to_xml(builder) entity.to_xml builder end |