Class: Basecamp::Types::Account

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

Overview

Account

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Account

Returns a new instance of Account.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/basecamp/generated/types.rb', line 75

def initialize(data = {})
  @created_at = parse_datetime(data["created_at"])
  @id = parse_integer(data["id"])
  @name = data["name"]
  @updated_at = parse_datetime(data["updated_at"])
  @active = parse_boolean(data["active"])
  @frozen = parse_boolean(data["frozen"])
  @limits = parse_type(data["limits"], "AccountLimits")
  @logo = parse_type(data["logo"], "AccountLogo")
  @owner_name = data["owner_name"]
  @paused = parse_boolean(data["paused"])
  @settings = parse_type(data["settings"], "AccountSettings")
  @subscription = parse_type(data["subscription"], "AccountSubscription")
  @trial = parse_boolean(data["trial"])
  @trial_ends_on = data["trial_ends_on"]
end

Instance Attribute Details

#activeObject

Returns the value of attribute active.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def active
  @active
end

#created_atObject

Returns the value of attribute created_at.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def created_at
  @created_at
end

#frozenObject

Returns the value of attribute frozen.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def frozen
  @frozen
end

#idObject

Returns the value of attribute id.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def id
  @id
end

#limitsObject

Returns the value of attribute limits.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def limits
  @limits
end

#logoObject

Returns the value of attribute logo.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def 
  @logo
end

#nameObject

Returns the value of attribute name.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def name
  @name
end

#owner_nameObject

Returns the value of attribute owner_name.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def owner_name
  @owner_name
end

#pausedObject

Returns the value of attribute paused.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def paused
  @paused
end

#settingsObject

Returns the value of attribute settings.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def settings
  @settings
end

#subscriptionObject

Returns the value of attribute subscription.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def subscription
  @subscription
end

#trialObject

Returns the value of attribute trial.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def trial
  @trial
end

#trial_ends_onObject

Returns the value of attribute trial_ends_on.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def trial_ends_on
  @trial_ends_on
end

#updated_atObject

Returns the value of attribute updated_at.



68
69
70
# File 'lib/basecamp/generated/types.rb', line 68

def updated_at
  @updated_at
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


71
72
73
# File 'lib/basecamp/generated/types.rb', line 71

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

Instance Method Details

#to_hObject



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/basecamp/generated/types.rb', line 92

def to_h
  {
    "created_at" => @created_at,
    "id" => @id,
    "name" => @name,
    "updated_at" => @updated_at,
    "active" => @active,
    "frozen" => @frozen,
    "limits" => @limits,
    "logo" => @logo,
    "owner_name" => @owner_name,
    "paused" => @paused,
    "settings" => @settings,
    "subscription" => @subscription,
    "trial" => @trial,
    "trial_ends_on" => @trial_ends_on,
  }.compact
end

#to_json(*args) ⇒ Object



111
112
113
# File 'lib/basecamp/generated/types.rb', line 111

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