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.
107 108 109 110 111 112 113 114 |
# File 'lib/smplkit/management/models.rb', line 107 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.
105 106 107 |
# File 'lib/smplkit/management/models.rb', line 105 def default_environment @default_environment end |
#environment_order ⇒ Object
Returns the value of attribute environment_order.
105 106 107 |
# File 'lib/smplkit/management/models.rb', line 105 def environment_order @environment_order end |
#id ⇒ Object
Returns the value of attribute id.
105 106 107 |
# File 'lib/smplkit/management/models.rb', line 105 def id @id end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
105 106 107 |
# File 'lib/smplkit/management/models.rb', line 105 def updated_at @updated_at end |
Instance Method Details
#_apply(other) ⇒ Object
125 126 127 128 129 130 |
# File 'lib/smplkit/management/models.rb', line 125 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!
116 117 118 119 120 121 122 |
# File 'lib/smplkit/management/models.rb', line 116 def save raise "AccountSettings was constructed without a client; cannot save" if @client.nil? updated = @client._update_account_settings(self) _apply(updated) self end |