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.



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

#errObject (readonly)

Returns the value of attribute err.



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

def err
  @err
end

#outObject (readonly)

Returns the value of attribute out.



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

def out
  @out
end

#resultObject (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

#err_streamObject



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

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

#failed?Boolean

Returns:

  • (Boolean)


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

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

#is_out_stream_empty?Boolean

Returns:

  • (Boolean)


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

def is_out_stream_empty?
  is_empty?(@out)
end

#out_streamObject



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

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