class CFF::Person

A Person represents a person in a CITATION.cff file. A Person might have a number of roles, such as author, contact, editor, etc.

Person implements all of the fields listed in the CFF standard. All fields are simple strings and can be set as such. A field which has not been set will return the empty string. The simple fields are (with defaults in parentheses):

Public Class Methods

new → Person click to toggle source
new { |person| block } → Person
new(given_name, family_name) → Person
new(given_name, family_name) { |person| block } → Person

Create a new Person with the optionally supplied given and family names.

Calls superclass method
# File lib/cff/person.rb, line 57
def initialize(param = nil, *more)
  super()

  if param.is_a?(Hash)
    @fields = param
  else
    @fields = {}

    unless param.nil?
      @fields['family-names'] = more[0]
      @fields['given-names'] = param
    end
  end

  yield self if block_given?
end