class QueryContext

Attributes

agent[R]
no_rack[R]
query[R]

Public Class Methods

new(agent, rack_env = false) click to toggle source
# File lib/optics-agent/query_context.rb, line 5
def initialize(agent, rack_env = false)
  @agent = agent
  @query = OpticsAgent::Reporting::Query.new
  @rack_env = rack_env
end

Public Instance Methods

query_finished!() click to toggle source
# File lib/optics-agent/query_context.rb, line 16
def query_finished!
  finish! unless @rack_env
end
request_finished!() click to toggle source
# File lib/optics-agent/query_context.rb, line 20
def request_finished!
  finish!
end
with_document(query_string) click to toggle source
# File lib/optics-agent/query_context.rb, line 11
def with_document(query_string)
  @query.document = query_string
  self
end

Private Instance Methods

finish!() click to toggle source
# File lib/optics-agent/query_context.rb, line 24
        def finish!
  if (@query.document)
    @agent.debug { "query_context: Adding a query with #{@query.reports.length} field reports" }
    @query.finish!
    @agent.add_query(@query, @rack_env)
  end
end