Class: ModsDisplay::Name::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/mods_display/fields/name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Person

Returns a new instance of Person.



106
107
108
109
110
111
112
113
# File 'lib/mods_display/fields/name.rb', line 106

def initialize(data)
  @name = data[:name]
  @orcid = if data[:orcid].present?
             data[:orcid]
           elsif data[:name_identifiers].present?
             orcid_identifier(data[:name_identifiers])
           end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



104
105
106
# File 'lib/mods_display/fields/name.rb', line 104

def name
  @name
end

#orcidObject

Returns the value of attribute orcid.



104
105
106
# File 'lib/mods_display/fields/name.rb', line 104

def orcid
  @orcid
end

Instance Method Details

#to_sObject



115
116
117
# File 'lib/mods_display/fields/name.rb', line 115

def to_s
  @name
end