Class: HalfShell::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/half_shell/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, status, stdout, stderr) ⇒ Result

Returns a new instance of Result.



5
6
7
8
# File 'lib/half_shell/result.rb', line 5

def initialize(command, status, stdout, stderr)
  @command = command
  @status, @stdout, @stderr = status, stdout, stderr
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



3
4
5
# File 'lib/half_shell/result.rb', line 3

def command
  @command
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/half_shell/result.rb', line 3

def status
  @status
end

#stderrObject (readonly)

Returns the value of attribute stderr.



3
4
5
# File 'lib/half_shell/result.rb', line 3

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



3
4
5
# File 'lib/half_shell/result.rb', line 3

def stdout
  @stdout
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/half_shell/result.rb', line 10

def to_s
  %Q{#<HalfShell::Result command="#{shorten(command)}" status=#{status} stdout="#{shorten(stdout)}" stderr="#{shorten(stderr)}">}
end