Class: Docker::Cli::CommandResult
- Inherits:
-
Object
- Object
- Docker::Cli::CommandResult
- Includes:
- TR::CondUtils
- Defined in:
- lib/docker/cli/command_result.rb
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #each_line(&block) ⇒ Object
- #err_stream ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(result, out, err) ⇒ CommandResult
constructor
A new instance of CommandResult.
- #is_err_stream_empty? ⇒ Boolean
- #is_out_stream_empty? ⇒ Boolean
- #lines ⇒ Object
- #out_stream ⇒ Object
- #success? ⇒ Boolean (also: #successful?)
Constructor Details
#initialize(result, out, err) ⇒ CommandResult
Returns a new instance of CommandResult.
12 13 14 15 16 |
# File 'lib/docker/cli/command_result.rb', line 12 def initialize(result, out, err) @result = result @out = out @err = err end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
11 12 13 |
# File 'lib/docker/cli/command_result.rb', line 11 def err @err end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
11 12 13 |
# File 'lib/docker/cli/command_result.rb', line 11 def out @out end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
11 12 13 |
# File 'lib/docker/cli/command_result.rb', line 11 def result @result end |
Instance Method Details
#each_line(&block) ⇒ Object
47 48 49 |
# File 'lib/docker/cli/command_result.rb', line 47 def each_line(&block) out_stream.each_line(&block) end |
#err_stream ⇒ Object
30 31 32 |
# File 'lib/docker/cli/command_result.rb', line 30 def err_stream @err.join("\n") end |
#failed? ⇒ Boolean
34 35 36 37 38 39 40 |
# File 'lib/docker/cli/command_result.rb', line 34 def failed? if @result.nil? true else @result.failed? end end |
#is_err_stream_empty? ⇒ Boolean
22 23 24 |
# File 'lib/docker/cli/command_result.rb', line 22 def is_err_stream_empty? is_empty?(@err) end |
#is_out_stream_empty? ⇒ Boolean
18 19 20 |
# File 'lib/docker/cli/command_result.rb', line 18 def is_out_stream_empty? is_empty?(@out) end |
#lines ⇒ Object
51 52 53 |
# File 'lib/docker/cli/command_result.rb', line 51 def lines out_stream.lines end |
#out_stream ⇒ Object
26 27 28 |
# File 'lib/docker/cli/command_result.rb', line 26 def out_stream @out.join("\n") end |
#success? ⇒ Boolean Also known as: successful?
42 43 44 |
# File 'lib/docker/cli/command_result.rb', line 42 def success? not failed? end |