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


522
523
524
# File 'lib/udb/obj/database_obj.rb', line 522

def initialize(data)
  @data = data
end

Instance Method Details

#<=>(other) ⇒ Integer?

Parameters:

Returns:

  • (Integer, nil)


527
528
529
530
531
# File 'lib/udb/obj/database_obj.rb', line 527

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



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

def company = @data["company"]

#emailnil, String

Returns:

  • (nil)

    if email address is not known

  • (String, nil)

    Email address



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

def email = @data["email"]

#nameString

Returns Person’s name.

Returns:

  • (String)

    Person’s name



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

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