Class: Aruba::Processes::InProcess::FakeKernel

Inherits:
Object
  • Object
show all
Defined in:
lib/aruba/processes/in_process.rb

Overview

Fake Kernel module of ruby

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFakeKernel

Returns a new instance of FakeKernel.



31
32
33
# File 'lib/aruba/processes/in_process.rb', line 31

def initialize
  @exitstatus = 0
end

Instance Attribute Details

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



29
30
31
# File 'lib/aruba/processes/in_process.rb', line 29

def exitstatus
  @exitstatus
end

Instance Method Details

#exit(exitstatus) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/aruba/processes/in_process.rb', line 35

def exit(exitstatus)
  @exitstatus =
    case exitstatus
    when Numeric then Integer(exitstatus)
    when TrueClass then 0
    when FalseClass then 1
    else raise TypeError, "no implicit conversion of #{exitstatus.class} into Integer"
    end
end