Class: Foodtaster::Vm::ExecResult

Inherits:
Object
  • Object
show all
Defined in:
lib/foodtaster/vm.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ ExecResult

Returns a new instance of ExecResult.



10
11
12
13
14
15
16
# File 'lib/foodtaster/vm.rb', line 10

def initialize(hash)
  if hash
    @stderr = hash[:stderr].to_s.chomp
    @stdout = hash[:stdout].to_s.chomp
    @exit_status = hash[:exit_status]
  end
end

Instance Attribute Details

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



8
9
10
# File 'lib/foodtaster/vm.rb', line 8

def exit_status
  @exit_status
end

#stderrObject (readonly)

Returns the value of attribute stderr.



6
7
8
# File 'lib/foodtaster/vm.rb', line 6

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



7
8
9
# File 'lib/foodtaster/vm.rb', line 7

def stdout
  @stdout
end

Instance Method Details

#successful?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/foodtaster/vm.rb', line 18

def successful?
  exit_status == 0
end