Class: Sprint::Status
- Inherits:
-
Object
- Object
- Sprint::Status
- Defined in:
- lib/sprint.rb
Class Method Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
- #good_output ⇒ Object
-
#initialize(output, status) ⇒ Status
constructor
A new instance of Status.
- #success? ⇒ Boolean (also: #to_b)
- #to_i ⇒ Object (also: #return_code, #to_int)
- #to_s ⇒ Object (also: #output, #to_str)
Constructor Details
#initialize(output, status) ⇒ Status
Returns a new instance of Status.
7 8 9 10 |
# File 'lib/sprint.rb', line 7 def initialize( output, status ) @output = output @status = status end |
Class Method Details
Instance Method Details
#check ⇒ Object
23 24 25 26 |
# File 'lib/sprint.rb', line 23 def check raise "Process exited with error code: #{return_code}" unless success? self end |
#good_output ⇒ Object
18 19 20 21 |
# File 'lib/sprint.rb', line 18 def good_output check @output end |
#success? ⇒ Boolean Also known as: to_b
34 35 36 |
# File 'lib/sprint.rb', line 34 def success? @status.success? end |
#to_i ⇒ Object Also known as: return_code, to_int
28 29 30 |
# File 'lib/sprint.rb', line 28 def to_i @status.exitstatus end |
#to_s ⇒ Object Also known as: output, to_str
12 13 14 |
# File 'lib/sprint.rb', line 12 def to_s @output end |