Class: Basecamp::Types::Account
- Inherits:
-
Object
- Object
- Basecamp::Types::Account
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
Account
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#frozen ⇒ Object
Returns the value of attribute frozen.
-
#id ⇒ Object
Returns the value of attribute id.
-
#limits ⇒ Object
Returns the value of attribute limits.
-
#logo ⇒ Object
Returns the value of attribute logo.
-
#name ⇒ Object
Returns the value of attribute name.
-
#owner_name ⇒ Object
Returns the value of attribute owner_name.
-
#paused ⇒ Object
Returns the value of attribute paused.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#subscription ⇒ Object
Returns the value of attribute subscription.
-
#trial ⇒ Object
Returns the value of attribute trial.
-
#trial_ends_on ⇒ Object
Returns the value of attribute trial_ends_on.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Account
constructor
A new instance of Account.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
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
#active ⇒ Object
Returns the value of attribute active.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def active @active end |
#created_at ⇒ Object
Returns the value of attribute created_at.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def created_at @created_at end |
#frozen ⇒ Object
Returns the value of attribute frozen.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def frozen @frozen end |
#id ⇒ Object
Returns the value of attribute id.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def id @id end |
#limits ⇒ Object
Returns the value of attribute limits.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def limits @limits end |
#logo ⇒ Object
Returns the value of attribute logo.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def logo @logo end |
#name ⇒ Object
Returns the value of attribute name.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def name @name end |
#owner_name ⇒ Object
Returns the value of attribute owner_name.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def owner_name @owner_name end |
#paused ⇒ Object
Returns the value of attribute paused.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def paused @paused end |
#settings ⇒ Object
Returns the value of attribute settings.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def settings @settings end |
#subscription ⇒ Object
Returns the value of attribute subscription.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def subscription @subscription end |
#trial ⇒ Object
Returns the value of attribute trial.
68 69 70 |
# File 'lib/basecamp/generated/types.rb', line 68 def trial @trial end |
#trial_ends_on ⇒ Object
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_at ⇒ Object
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_fields ⇒ 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_h ⇒ Object
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 |