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.



37
38
39
40
# File 'lib/optics-agent/rack-middleware.rb', line 37

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

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



36
37
38
# File 'lib/optics-agent/rack-middleware.rb', line 36

def agent
  @agent
end

#queryObject (readonly)

Returns the value of attribute query.



36
37
38
# File 'lib/optics-agent/rack-middleware.rb', line 36

def query
  @query
end

Instance Method Details

#with_document(query_string) ⇒ Object



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

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