Class: Pkgr::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/pkgr/process.rb

Constant Summary collapse

DAEMON_PROCESSES =
["web", "worker"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, command, scale = 1) ⇒ Process

Returns a new instance of Process.



8
9
10
11
12
# File 'lib/pkgr/process.rb', line 8

def initialize(name, command, scale = 1)
  @name = name
  @command = command
  @scale = scale || 1
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



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

def command
  @command
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#scaleObject

Returns the value of attribute scale.



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

def scale
  @scale
end

Instance Method Details

#daemon?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/pkgr/process.rb', line 14

def daemon?
  DAEMON_PROCESSES.include?(name)
end