Class: Frontkick::Result
- Inherits:
-
Object
- Object
- Frontkick::Result
- Defined in:
- lib/frontkick/result.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#exit_code ⇒ Object
(also: #status, #exitstatus)
Returns the value of attribute exit_code.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(params = {}) ⇒ Result
constructor
A new instance of Result.
- #output ⇒ Object
- #successful? ⇒ Boolean (also: #success?)
Constructor Details
#initialize(params = {}) ⇒ Result
Returns a new instance of Result.
9 10 11 12 13 14 |
# File 'lib/frontkick/result.rb', line 9 def initialize(params = {}) @stdout = params[:stdout] || "" @stderr = params[:stderr] || "" @exit_code = params[:exit_code] # exit_code would be nil if child process is killed -9 @duration = params[:duration] || 0 end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
3 4 5 |
# File 'lib/frontkick/result.rb', line 3 def duration @duration end |
#exit_code ⇒ Object Also known as: status, exitstatus
Returns the value of attribute exit_code.
3 4 5 |
# File 'lib/frontkick/result.rb', line 3 def exit_code @exit_code end |
#stderr ⇒ Object
Returns the value of attribute stderr.
3 4 5 |
# File 'lib/frontkick/result.rb', line 3 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
3 4 5 |
# File 'lib/frontkick/result.rb', line 3 def stdout @stdout end |
Instance Method Details
#errors ⇒ Object
20 21 22 |
# File 'lib/frontkick/result.rb', line 20 def errors @stderr end |
#output ⇒ Object
16 17 18 |
# File 'lib/frontkick/result.rb', line 16 def output @stdout end |
#successful? ⇒ Boolean Also known as: success?
24 25 26 |
# File 'lib/frontkick/result.rb', line 24 def successful? @exit_code == 0 end |