Class: IsoBibItem::ContributionInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/iso_bib_item/contribution_info.rb

Overview

Contribution info.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity:, role: ['publisher']) ⇒ ContributionInfo

Returns a new instance of ContributionInfo.

Parameters:



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

#entityObject (readonly)

Returns [IsoBibItem::Person, IsoBibItem::Organization,

IsoBibItem::IsoProjectGroup].

Returns:

  • [IsoBibItem::Person, IsoBibItem::Organization,

    IsoBibItem::IsoProjectGroup]
    


40
41
42
# File 'lib/iso_bib_item/contribution_info.rb', line 40

def entity
  @entity
end

#roleArray<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