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.



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

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.



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

def name
  @name
end

#orcidObject

Returns the value of attribute orcid.



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

def orcid
  @orcid
end

Instance Method Details

#to_sObject



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

def to_s
  @name
end