Class: ModsDisplay::Name::Person
- Inherits:
-
Object
- Object
- ModsDisplay::Name::Person
- Defined in:
- lib/mods_display/fields/name.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#orcid ⇒ Object
Returns the value of attribute orcid.
Instance Method Summary collapse
-
#initialize(data) ⇒ Person
constructor
A new instance of Person.
- #to_s ⇒ Object
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
#name ⇒ Object
Returns the value of attribute name.
105 106 107 |
# File 'lib/mods_display/fields/name.rb', line 105 def name @name end |
#orcid ⇒ Object
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_s ⇒ Object
116 117 118 |
# File 'lib/mods_display/fields/name.rb', line 116 def to_s @name end |