Class: RelatonBib::Contact
Overview
Contact class.
Instance Attribute Summary collapse
-
#type ⇒ String
readonly
Allowed “phone”, “email” or “uri”.
- #value ⇒ String readonly
Instance Method Summary collapse
-
#initialize(type:, value:) ⇒ Contact
constructor
A new instance of Contact.
- #to_hash ⇒ Hash
- #to_xml(doc) ⇒ Object
Constructor Details
#initialize(type:, value:) ⇒ Contact
Returns a new instance of Contact.
69 70 71 72 |
# File 'lib/relaton_bib/contributor.rb', line 69 def initialize(type:, value:) @type = type @value = value end |
Instance Attribute Details
#type ⇒ String (readonly)
Returns allowed “phone”, “email” or “uri”.
62 63 64 |
# File 'lib/relaton_bib/contributor.rb', line 62 def type @type end |
#value ⇒ String (readonly)
65 66 67 |
# File 'lib/relaton_bib/contributor.rb', line 65 def value @value end |
Instance Method Details
#to_hash ⇒ Hash
80 81 82 |
# File 'lib/relaton_bib/contributor.rb', line 80 def to_hash { "type" => type, "value" => value } end |
#to_xml(doc) ⇒ Object
75 76 77 |
# File 'lib/relaton_bib/contributor.rb', line 75 def to_xml(doc) doc.send type, value end |