Class: QueryContext
- Inherits:
-
Object
- Object
- QueryContext
- Defined in:
- lib/optics-agent/query_context.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#no_rack ⇒ Object
readonly
Returns the value of attribute no_rack.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(agent, rack_env = false) ⇒ QueryContext
constructor
A new instance of QueryContext.
- #query_finished! ⇒ Object
- #request_finished! ⇒ Object
- #with_document(query_string) ⇒ Object
Constructor Details
#initialize(agent, rack_env = false) ⇒ QueryContext
Returns a new instance of QueryContext.
5 6 7 8 9 |
# 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 |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
4 5 6 |
# File 'lib/optics-agent/query_context.rb', line 4 def agent @agent end |
#no_rack ⇒ Object (readonly)
Returns the value of attribute no_rack.
4 5 6 |
# File 'lib/optics-agent/query_context.rb', line 4 def no_rack @no_rack end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
4 5 6 |
# File 'lib/optics-agent/query_context.rb', line 4 def query @query end |
Instance Method Details
#query_finished! ⇒ Object
16 17 18 |
# File 'lib/optics-agent/query_context.rb', line 16 def query_finished! finish! unless @rack_env end |
#request_finished! ⇒ Object
20 21 22 |
# File 'lib/optics-agent/query_context.rb', line 20 def request_finished! finish! end |
#with_document(query_string) ⇒ Object
11 12 13 14 |
# File 'lib/optics-agent/query_context.rb', line 11 def with_document(query_string) @query.document = query_string self end |