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

#command ⇒ Object

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

#pid ⇒ Object

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

#stat ⇒ Object

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

#tty ⇒ Object

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

#agent ⇒ Object



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?("+")

#name ⇒ Object



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