Class: IsoBibItem::Contact

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

Overview

Contact class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:) ⇒ Contact

Returns a new instance of Contact.

Parameters:

  • phone (String)


57
58
59
60
# File 'lib/iso_bib_item/contributor.rb', line 57

def initialize(type:, value:)
  @type  = type
  @value = value
end

Instance Attribute Details

#typeString (readonly)

Returns allowed “phone”, “email” or “uri”.

Returns:

  • (String)

    allowed “phone”, “email” or “uri”



51
52
53
# File 'lib/iso_bib_item/contributor.rb', line 51

def type
  @type
end

#valueString (readonly)

Returns:

  • (String)


54
55
56
# File 'lib/iso_bib_item/contributor.rb', line 54

def value
  @value
end

Instance Method Details

#to_xml(doc) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Document)


63
64
65
# File 'lib/iso_bib_item/contributor.rb', line 63

def to_xml(doc)
  doc.send type, value
end