Class: Smplkit::Management::AccountSettings
- Inherits:
-
Object
- Object
- Smplkit::Management::AccountSettings
- Defined in:
- lib/smplkit/management/models.rb
Overview
An account-wide settings resource.
Instance Attribute Summary collapse
-
#default_environment ⇒ Object
Returns the value of attribute default_environment.
-
#environment_order ⇒ Object
Returns the value of attribute environment_order.
-
#id ⇒ Object
Returns the value of attribute id.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #_apply(other) ⇒ Object
-
#initialize(client = nil, id: nil, environment_order: nil, default_environment: nil, updated_at: nil) ⇒ AccountSettings
constructor
A new instance of AccountSettings.
- #save ⇒ Object (also: #save!)
Constructor Details
#initialize(client = nil, id: nil, environment_order: nil, default_environment: nil, updated_at: nil) ⇒ AccountSettings
Returns a new instance of AccountSettings.
152 153 154 155 156 157 158 159 |
# File 'lib/smplkit/management/models.rb', line 152 def initialize(client = nil, id: nil, environment_order: nil, default_environment: nil, updated_at: nil) @client = client @id = id @environment_order = environment_order || [] @default_environment = default_environment @updated_at = updated_at end |
Instance Attribute Details
#default_environment ⇒ Object
Returns the value of attribute default_environment.
150 151 152 |
# File 'lib/smplkit/management/models.rb', line 150 def default_environment @default_environment end |
#environment_order ⇒ Object
Returns the value of attribute environment_order.
150 151 152 |
# File 'lib/smplkit/management/models.rb', line 150 def environment_order @environment_order end |
#id ⇒ Object
Returns the value of attribute id.
150 151 152 |
# File 'lib/smplkit/management/models.rb', line 150 def id @id end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
150 151 152 |
# File 'lib/smplkit/management/models.rb', line 150 def updated_at @updated_at end |
Instance Method Details
#_apply(other) ⇒ Object
170 171 172 173 174 175 |
# File 'lib/smplkit/management/models.rb', line 170 def _apply(other) @id = other.id @environment_order = other.environment_order @default_environment = other.default_environment @updated_at = other.updated_at end |
#save ⇒ Object Also known as: save!
161 162 163 164 165 166 167 |
# File 'lib/smplkit/management/models.rb', line 161 def save raise "AccountSettings was constructed without a client; cannot save" if @client.nil? updated = @client._update_account_settings(self) _apply(updated) self end |