Class: AgentsControl::ProcessProbe::Process

Inherits:
Struct
  • Object
show all
Defined in:
lib/agents_control/process_probe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandObject

Returns the value of attribute command

Returns:

  • (Object)

    the current value of command



25
26
27
# File 'lib/agents_control/process_probe.rb', line 25

def command
  @command
end

#pidObject

Returns the value of attribute pid

Returns:

  • (Object)

    the current value of pid



25
26
27
# File 'lib/agents_control/process_probe.rb', line 25

def pid
  @pid
end

#statObject

Returns the value of attribute stat

Returns:

  • (Object)

    the current value of stat



25
26
27
# File 'lib/agents_control/process_probe.rb', line 25

def stat
  @stat
end

#ttyObject

Returns the value of attribute tty

Returns:

  • (Object)

    the current value of tty



25
26
27
# File 'lib/agents_control/process_probe.rb', line 25

def tty
  @tty
end

Instance Method Details

#agentObject



30
# File 'lib/agents_control/process_probe.rb', line 30

def agent = AGENT_BINARIES[name]

#agent?Boolean

Returns:

  • (Boolean)


31
# File 'lib/agents_control/process_probe.rb', line 31

def agent? = !agent.nil?

#foreground?Boolean

+ in the stat column marks a process in the foreground group — i.e. what the user is currently interacting with.

Returns:

  • (Boolean)


28
# File 'lib/agents_control/process_probe.rb', line 28

def foreground? = stat.to_s.include?("+")

#nameObject



29
# File 'lib/agents_control/process_probe.rb', line 29

def name = File.basename(command.to_s)

#terminal?Boolean

Returns:

  • (Boolean)


32
# File 'lib/agents_control/process_probe.rb', line 32

def terminal? = tty != NO_TTY