Class: FireAndForget::Command::GetPid

Inherits:
CommandBase show all
Defined in:
lib/fire_and_forget/command/get_pid.rb

Instance Attribute Summary collapse

Attributes inherited from CommandBase

#cmd, #params, #tag, #task

Instance Method Summary collapse

Methods inherited from CommandBase

#debug, #dump, #merge_params

Constructor Details

#initialize(task_name) ⇒ GetPid

Returns a new instance of GetPid.



7
8
9
# File 'lib/fire_and_forget/command/get_pid.rb', line 7

def initialize(task_name)
  @task_name = task_name.to_sym
end

Instance Attribute Details

#pidObject (readonly)

Returns the value of attribute pid.



5
6
7
# File 'lib/fire_and_forget/command/get_pid.rb', line 5

def pid
  @pid
end

#task_nameObject (readonly)

Returns the value of attribute task_name.



5
6
7
# File 'lib/fire_and_forget/command/get_pid.rb', line 5

def task_name
  @task_name
end

Instance Method Details

#runObject



11
12
13
# File 'lib/fire_and_forget/command/get_pid.rb', line 11

def run
  FireAndForget::Server.pids[@task_name]
end