Class: Udb::Person

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Comparable
Defined in:
lib/udb/obj/database_obj.rb

Overview

Personal information about a contributor

Instance Method Summary collapse

Constructor Details

#initialize(data)

Parameters:

  • data (Hash{String => String, nil})


524
525
526
# File 'lib/udb/obj/database_obj.rb', line 524

def initialize(data)
  @data = data
end

Instance Method Details

#<=>(other) ⇒ Integer?

Parameters:

Returns:

  • (Integer, nil)


529
530
531
532
533
# File 'lib/udb/obj/database_obj.rb', line 529

def <=>(other)
  return nil unless other.is_a?(Person)

  name <=> other.name
end

#companynil, String

Returns:

  • (nil)

    if the company is not known, or if the person is an individual contributor

  • (String, nil)

    Company the person works for



521
# File 'lib/udb/obj/database_obj.rb', line 521

def company = @data["company"]

#emailnil, String

Returns:

  • (nil)

    if email address is not known

  • (String, nil)

    Email address



516
# File 'lib/udb/obj/database_obj.rb', line 516

def email = @data["email"]

#nameString

Returns Person’s name.

Returns:

  • (String)

    Person’s name



511
# File 'lib/udb/obj/database_obj.rb', line 511

def name = T.must(@data["name"])