Class: Qs::Heroku::Client::App
- Inherits:
-
Object
- Object
- Qs::Heroku::Client::App
- Defined in:
- lib/qs/heroku/client/app.rb
Constant Summary collapse
- SIZES =
{ '1x' => 1, '2x' => 2 }
Instance Method Summary collapse
- #formation ⇒ Object
-
#initialize(id, connection) ⇒ App
constructor
A new instance of App.
- #scale(type, quantity, size = nil) ⇒ Object
Constructor Details
#initialize(id, connection) ⇒ App
Returns a new instance of App.
13 14 15 16 |
# File 'lib/qs/heroku/client/app.rb', line 13 def initialize(id, connection) @id = id @connection = connection end |
Instance Method Details
#formation ⇒ Object
18 19 20 21 |
# File 'lib/qs/heroku/client/app.rb', line 18 def formation response = @connection.request(:get, "/apps/#{CGI.escape(@id)}/formation") parse_formation(response) end |
#scale(type, quantity, size = nil) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/qs/heroku/client/app.rb', line 23 def scale(type, quantity, size = nil) = {'quantity' => quantity} if size raise Error.new("Unknown size: #{size}!") unless SIZES[size] ['size'] = SIZES[size] end response = @connection.request(:patch, "/apps/#{CGI.escape(@id)}/formation/#{CGI.escape(type)}", ) parse_formation(response) end |