Class: Docker::Cli::CommandResult

Inherits:
Object
  • Object
show all
Includes:
TR::CondUtils
Defined in:
lib/docker/cli/command_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result, out, err) ⇒ CommandResult

Returns a new instance of CommandResult.



11
12
13
14
15
# File 'lib/docker/cli/command_result.rb', line 11

def initialize(result, out, err)
  @result = result
  @out = out
  @err = err
end

Instance Attribute Details

#errObject (readonly)

Returns the value of attribute err.



10
11
12
# File 'lib/docker/cli/command_result.rb', line 10

def err
  @err
end

#outObject (readonly)

Returns the value of attribute out.



10
11
12
# File 'lib/docker/cli/command_result.rb', line 10

def out
  @out
end

#resultObject (readonly)

Returns the value of attribute result.



10
11
12
# File 'lib/docker/cli/command_result.rb', line 10

def result
  @result
end

Instance Method Details

#err_streamObject



25
26
27
# File 'lib/docker/cli/command_result.rb', line 25

def err_stream
  @err.join("\n")
end

#failed?Boolean

Returns:

  • (Boolean)


29
30
31
32
33
34
35
# File 'lib/docker/cli/command_result.rb', line 29

def failed?
  if @result.nil?
    true
  else
    @result.failed?
  end
end

#is_out_stream_empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/docker/cli/command_result.rb', line 17

def is_out_stream_empty?
  is_empty?(@out)
end

#out_streamObject



21
22
23
# File 'lib/docker/cli/command_result.rb', line 21

def out_stream
  @out.join("\n") 
end