Class: Papa::Runner
- Inherits:
-
Object
- Object
- Papa::Runner
- Defined in:
- lib/papa/runner.rb
Instance Attribute Summary collapse
-
#last_command ⇒ Object
Returns the value of attribute last_command.
-
#last_error ⇒ Object
Returns the value of attribute last_error.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#success ⇒ Object
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(queue) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(queue) ⇒ Runner
Returns a new instance of Runner.
5 6 7 |
# File 'lib/papa/runner.rb', line 5 def initialize(queue) @queue = queue || [] end |
Instance Attribute Details
#last_command ⇒ Object
Returns the value of attribute last_command.
3 4 5 |
# File 'lib/papa/runner.rb', line 3 def last_command @last_command end |
#last_error ⇒ Object
Returns the value of attribute last_error.
3 4 5 |
# File 'lib/papa/runner.rb', line 3 def last_error @last_error end |
#queue ⇒ Object
Returns the value of attribute queue.
3 4 5 |
# File 'lib/papa/runner.rb', line 3 def queue @queue end |
#success ⇒ Object
Returns the value of attribute success.
3 4 5 |
# File 'lib/papa/runner.rb', line 3 def success @success end |
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/papa/runner.rb', line 9 def run @success = true = nil @queue.each do |command| if command.run.failed? @success = false command.cleanup @last_error = command. break end end @success end |