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



180
181
182
183
184
185
186
187
# File 'lib/mods_display/fields/name.rb', line 180

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.



178
179
180
# File 'lib/mods_display/fields/name.rb', line 178

def name
  @name
end

#orcidObject

Returns the value of attribute orcid.



178
179
180
# File 'lib/mods_display/fields/name.rb', line 178

def orcid
  @orcid
end

Instance Method Details

#to_sObject



189
190
191
# File 'lib/mods_display/fields/name.rb', line 189

def to_s
  @name
end