Class: Aptible::Api::Account
- Defined in:
- lib/aptible/api/account.rb
Class Method Summary collapse
Instance Method Summary collapse
- #billforward_subscription ⇒ Object
- #dumptruck_port ⇒ Object
- #operations ⇒ Object
- #organization ⇒ Object
- #production? ⇒ Boolean
Methods inherited from Resource
Class Method Details
.generate_handle(organization_name, plan_id) ⇒ Object
55 56 57 58 |
# File 'lib/aptible/api/account.rb', line 55 def self.generate_handle(organization_name, plan_id) rand = ('a'..'z').to_a.shuffle[0, 8].join "#{organization_name.parameterize}-#{plan_id}-#{rand}" end |
Instance Method Details
#billforward_subscription ⇒ Object
30 31 32 33 34 |
# File 'lib/aptible/api/account.rb', line 30 def billforward_subscription return nil if billforward_subscription_id.nil? @billforward_subscription ||= Aptible::BillForward::Subscription.find(billforward_subscription_id) end |
#dumptruck_port ⇒ Object
45 46 47 48 |
# File 'lib/aptible/api/account.rb', line 45 def dumptruck_port # TODO: Fetch from API 45022 end |
#operations ⇒ Object
40 41 42 43 |
# File 'lib/aptible/api/account.rb', line 40 def operations # TODO: Implement /accounts/:id/operations [] end |
#organization ⇒ Object
50 51 52 53 |
# File 'lib/aptible/api/account.rb', line 50 def organization auth = Aptible::Auth::Organization.new(token: token, headers: headers) auth.find_by_url(links['organization'].href) end |
#production? ⇒ Boolean
36 37 38 |
# File 'lib/aptible/api/account.rb', line 36 def production? type == 'production' end |