Class: RelatonBib::Contact

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

Overview

Contact class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:) ⇒ 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

#typeString (readonly)



62
63
64
# File 'lib/relaton_bib/contributor.rb', line 62

def type
  @type
end

#valueString (readonly)



65
66
67
# File 'lib/relaton_bib/contributor.rb', line 65

def value
  @value
end

Instance Method Details

#to_hashHash



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