class Polyseerio::Agent::Agent

Polyseer.io Ruby agent.

Attributes

client[RW]
instance[RW]

Public Class Methods

new(client) click to toggle source
# File lib/agent/agent.rb, line 9
def initialize(client)
  @client = client
end

Public Instance Methods

start(*args) click to toggle source

Starts the agent.

# File lib/agent/agent.rb, line 14
def start(*args)
  Polyseerio.log 'debug', 'Starting agent.'

  Executor.setup(client, *args)
          .then do |instance|
            @instance = instance

            client
          end
end
stop() click to toggle source

Stops the agent.

# File lib/agent/agent.rb, line 26
def stop
  Executor.teardown(client, instance).then do
    @instance = nil
  end
end