Class: Smartguard::Process

Inherits:
Object
  • Object
show all
Includes:
DRb::DRbUndumped
Defined in:
lib/smartguard/process.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Process

Returns a new instance of Process.



8
9
10
11
12
13
14
# File 'lib/smartguard/process.rb', line 8

def initialize(path)
  @active = false
  @pid = nil
  @path = path
  @wanted = false
  @starting = false
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



6
7
8
# File 'lib/smartguard/process.rb', line 6

def path
  @path
end

#pidObject (readonly)

Returns the value of attribute pid.



5
6
7
# File 'lib/smartguard/process.rb', line 5

def pid
  @pid
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/smartguard/process.rb', line 43

def active?
  @active
end

#startObject



35
36
37
# File 'lib/smartguard/process.rb', line 35

def start
  @wanted = true
end

#stopObject



39
40
41
# File 'lib/smartguard/process.rb', line 39

def stop
  @wanted = false
end

#wanted?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/smartguard/process.rb', line 47

def wanted?
  @wanted
end