Class: Basecamp::Types::Person

Inherits:
Object
  • Object
show all
Includes:
TypeHelpers
Defined in:
lib/basecamp/generated/types.rb

Overview

Person

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Person

Returns a new instance of Person.



2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
# File 'lib/basecamp/generated/types.rb', line 2765

def initialize(data = {})
  @id = parse_integer(data["id"])
  @system_label = data["system_label"]
  @name = data["name"]
  @admin = parse_boolean(data["admin"])
  @attachable_sgid = data["attachable_sgid"]
  @avatar_url = data["avatar_url"]
  @bio = data["bio"]
  @can_access_hill_charts = parse_boolean(data["can_access_hill_charts"])
  @can_access_timesheet = parse_boolean(data["can_access_timesheet"])
  @can_manage_people = parse_boolean(data["can_manage_people"])
  @can_manage_projects = parse_boolean(data["can_manage_projects"])
  @can_ping = parse_boolean(data["can_ping"])
  @client = parse_boolean(data["client"])
  @company = parse_type(data["company"], "PersonCompany")
  @created_at = parse_datetime(data["created_at"])
  @email_address = data["email_address"]
  @employee = parse_boolean(data["employee"])
  @location = data["location"]
  @owner = parse_boolean(data["owner"])
  @personable_type = data["personable_type"]
  @tagline = data["tagline"]
  @time_zone = data["time_zone"]
  @title = data["title"]
  @updated_at = parse_datetime(data["updated_at"])
end

Instance Attribute Details

#adminObject

Returns the value of attribute admin.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def admin
  @admin
end

#attachable_sgidObject

Returns the value of attribute attachable_sgid.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def attachable_sgid
  @attachable_sgid
end

#avatar_urlObject

Returns the value of attribute avatar_url.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def avatar_url
  @avatar_url
end

#bioObject

Returns the value of attribute bio.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def bio
  @bio
end

#can_access_hill_chartsObject

Returns the value of attribute can_access_hill_charts.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def can_access_hill_charts
  @can_access_hill_charts
end

#can_access_timesheetObject

Returns the value of attribute can_access_timesheet.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def can_access_timesheet
  @can_access_timesheet
end

#can_manage_peopleObject

Returns the value of attribute can_manage_people.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def can_manage_people
  @can_manage_people
end

#can_manage_projectsObject

Returns the value of attribute can_manage_projects.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def can_manage_projects
  @can_manage_projects
end

#can_pingObject

Returns the value of attribute can_ping.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def can_ping
  @can_ping
end

#clientObject

Returns the value of attribute client.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def client
  @client
end

#companyObject

Returns the value of attribute company.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def company
  @company
end

#created_atObject

Returns the value of attribute created_at.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def created_at
  @created_at
end

#email_addressObject

Returns the value of attribute email_address.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def email_address
  @email_address
end

#employeeObject

Returns the value of attribute employee.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def employee
  @employee
end

#idObject

Returns the value of attribute id.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def id
  @id
end

#locationObject

Returns the value of attribute location.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def location
  @location
end

#nameObject

Returns the value of attribute name.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def name
  @name
end

#ownerObject

Returns the value of attribute owner.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def owner
  @owner
end

#personable_typeObject

Returns the value of attribute personable_type.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def personable_type
  @personable_type
end

#system_labelObject

Returns the value of attribute system_label.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def system_label
  @system_label
end

#taglineObject

Returns the value of attribute tagline.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def tagline
  @tagline
end

#time_zoneObject

Returns the value of attribute time_zone.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def time_zone
  @time_zone
end

#titleObject

Returns the value of attribute title.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at.



2758
2759
2760
# File 'lib/basecamp/generated/types.rb', line 2758

def updated_at
  @updated_at
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


2761
2762
2763
# File 'lib/basecamp/generated/types.rb', line 2761

def self.required_fields
  %i[id name].freeze
end

Instance Method Details

#to_hObject



2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
# File 'lib/basecamp/generated/types.rb', line 2792

def to_h
  {
    "id" => @id,
    "name" => @name,
    "admin" => @admin,
    "attachable_sgid" => @attachable_sgid,
    "avatar_url" => @avatar_url,
    "bio" => @bio,
    "can_access_hill_charts" => @can_access_hill_charts,
    "can_access_timesheet" => @can_access_timesheet,
    "can_manage_people" => @can_manage_people,
    "can_manage_projects" => @can_manage_projects,
    "can_ping" => @can_ping,
    "client" => @client,
    "company" => @company,
    "created_at" => @created_at,
    "email_address" => @email_address,
    "employee" => @employee,
    "location" => @location,
    "owner" => @owner,
    "personable_type" => @personable_type,
    "tagline" => @tagline,
    "time_zone" => @time_zone,
    "title" => @title,
    "updated_at" => @updated_at,
  }.compact
end

#to_json(*args) ⇒ Object



2820
2821
2822
# File 'lib/basecamp/generated/types.rb', line 2820

def to_json(*args)
  to_h.to_json(*args)
end