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


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

def initialize(data)
  @data = data
end

Instance Method Details

#<=>(other) ⇒ Integer?

Parameters:

Returns:

  • (Integer, nil)


531
532
533
534
535
# File 'lib/udb/obj/database_obj.rb', line 531

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



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

def company = @data["company"]

#emailnil, String

Returns:

  • (nil)

    if email address is not known

  • (String, nil)

    Email address



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

def email = @data["email"]

#nameString

Returns Person’s name.

Returns:

  • (String)

    Person’s name



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

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