class IsoBibItem::ContributorRole
Contributor's role.
Attributes
description[R]
@return [Array<IsoBibItem::FormattedString>]
type[R]
@return [ContributorRoleType]
Public Class Methods
new(*args)
click to toggle source
@param type [String] allowed types “author”, “editor”,
"cartographer", "publisher"
@param description [Array<String>]
# File lib/iso_bib_item/contribution_info.rb, line 18 def initialize(*args) @type = args.fetch 0 @description = args.fetch(1, []).map { |d| FormattedString.new content: d, type: nil } end
Public Instance Methods
to_xml(builder)
click to toggle source
# File lib/iso_bib_item/contribution_info.rb, line 23 def to_xml(builder) builder.role(type: type) do description.each do |d| builder.description { |desc| d.to_xml(desc) } end end end