Class: Heroku::Process
- Inherits:
-
Object
- Object
- Heroku::Process
- Defined in:
- lib/heroku/process.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Process
constructor
A new instance of Process.
- #refresh_status! ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Process
Returns a new instance of Process.
6 7 8 9 10 11 12 |
# File 'lib/heroku/process.rb', line 6 def initialize( = {}) @app = [:app] @logger = [:logger] @pid = [:pid] @status = [:status] raise Heroku::Commander::Errors::MissingPidError unless @pid end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
4 5 6 |
# File 'lib/heroku/process.rb', line 4 def app @app end |
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/heroku/process.rb', line 4 def logger @logger end |
#pid ⇒ Object
Returns the value of attribute pid.
4 5 6 |
# File 'lib/heroku/process.rb', line 4 def pid @pid end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/heroku/process.rb', line 4 def status @status end |
Instance Method Details
#refresh_status! ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/heroku/process.rb', line 14 def refresh_status! refreshed = false Heroku::Commander.new({ :logger => logger, :app => app }).processes.each do |process| next unless ! refreshed && process.pid == pid @status = process.status refreshed = true end refreshed end |