Class: EngineyardAPI::Account
- Inherits:
-
Object
- Object
- EngineyardAPI::Account
- Defined in:
- lib/engineyard-api/account.rb
Overview
Users (and API keys) can have access to multiple accounts.
Instance Attribute Summary collapse
-
#environments ⇒ Object
readonly
Returns a list of environments in an Array.
-
#id ⇒ Object
readonly
Returns account id as an Integer.
-
#name ⇒ Object
readonly
Returns Account name as a String.
Instance Method Summary collapse
-
#initialize(account) ⇒ Account
constructor
:nodoc:.
Constructor Details
#initialize(account) ⇒ Account
:nodoc:
12 13 14 15 16 |
# File 'lib/engineyard-api/account.rb', line 12 def initialize(account) # :nodoc: @id = account['id'] if account.has_key? 'id' @name = account['name'] if account.has_key? 'name' @environments = account.has_key?(environments) ? account['environments'] : [] end |
Instance Attribute Details
#environments ⇒ Object (readonly)
Returns a list of environments in an Array
9 10 11 |
# File 'lib/engineyard-api/account.rb', line 9 def environments @environments end |
#id ⇒ Object (readonly)
Returns account id as an Integer
5 6 7 |
# File 'lib/engineyard-api/account.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns Account name as a String
7 8 9 |
# File 'lib/engineyard-api/account.rb', line 7 def name @name end |