Class: Arxiv::Author

Inherits:
Object
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/arxiv/models/author.rb

Instance Method Summary collapse

Instance Method Details

#first_nameObject

Unfortunately, the ArXiv API does not provide separate attributes for ‘author.first_name` and `author.last_name`; it only provides a single `author.name` attribute.

Yet most standards within academic publishing (e.g. JATS XML) prefer to differentiate first name and last name of authors. To support that expectation, we’ve split the name value (leveraging a third-party gem). Ideally, ArXiv would provide this data directly. But until then, this solution should be suitable.



17
18
19
# File 'lib/arxiv/models/author.rb', line 17

def first_name
  FullNameSplitter.split(name).first
end

#last_nameObject

See code comment for ‘first_name`.



23
24
25
# File 'lib/arxiv/models/author.rb', line 23

def last_name
  FullNameSplitter.split(name).last
end