Class: Aptible::Api::Account
- Defined in:
- lib/aptible/api/account.rb
Class Method Summary collapse
Instance Method Summary collapse
- #dumptruck_port ⇒ Object
- #operations ⇒ Object
- #organization ⇒ Object
- #organization_url ⇒ Object
- #production? ⇒ Boolean
Methods inherited from Resource
Class Method Details
.generate_handle(organization_name, plan_id) ⇒ Object
57 58 59 60 |
# File 'lib/aptible/api/account.rb', line 57 def self.generate_handle(organization_name, plan_id) rand = ('a'..'z').to_a.sample(8).join "#{organization_name.parameterize}-#{plan_id}-#{rand}" end |
Instance Method Details
#dumptruck_port ⇒ Object
42 43 44 45 |
# File 'lib/aptible/api/account.rb', line 42 def dumptruck_port # TODO: Fetch from API 45022 end |
#operations ⇒ Object
37 38 39 40 |
# File 'lib/aptible/api/account.rb', line 37 def operations # TODO: Implement /accounts/:id/operations [] end |
#organization ⇒ Object
51 52 53 54 55 |
# File 'lib/aptible/api/account.rb', line 51 def organization return @organization if @organization auth = Aptible::Auth::Organization.new(token: token, headers: headers) @organization = auth.find_by_url(organization_url) end |
#organization_url ⇒ Object
47 48 49 |
# File 'lib/aptible/api/account.rb', line 47 def organization_url links['organization'].href end |
#production? ⇒ Boolean
33 34 35 |
# File 'lib/aptible/api/account.rb', line 33 def production? type == 'production' end |