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})


541
542
543
# File 'lib/udb/obj/database_obj.rb', line 541

def initialize(data)
  @data = data
end

Instance Method Details

#<=>(other) ⇒ Integer?

Parameters:

Returns:

  • (Integer, nil)


546
547
548
549
550
# File 'lib/udb/obj/database_obj.rb', line 546

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



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

def company = @data["company"]

#emailnil, String

Returns:

  • (nil)

    if email address is not known

  • (String, nil)

    Email address



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

def email = @data["email"]

#nameString

Returns Person's name.

Returns:

  • (String)

    Person's name



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

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