Class: OpticsAgent::RackAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/optics-agent/rack-middleware.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent, query) ⇒ RackAgent

Returns a new instance of RackAgent.



43
44
45
46
# File 'lib/optics-agent/rack-middleware.rb', line 43

def initialize(agent, query)
  @agent = agent
  @query = query
end

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



42
43
44
# File 'lib/optics-agent/rack-middleware.rb', line 42

def agent
  @agent
end

#queryObject (readonly)

Returns the value of attribute query.



42
43
44
# File 'lib/optics-agent/rack-middleware.rb', line 42

def query
  @query
end

Instance Method Details

#with_document(query_string) ⇒ Object



48
49
50
51
# File 'lib/optics-agent/rack-middleware.rb', line 48

def with_document(query_string)
  @query.document = query_string
  self
end