Class: Rack::Insight::ActiveResourcePanel::RequestResult
- Inherits:
-
Object
- Object
- Rack::Insight::ActiveResourcePanel::RequestResult
- Includes:
- FilteredBacktrace
- Defined in:
- lib/rack/insight/panels/active_resource_panel/query.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#result ⇒ Object
(also: #results)
readonly
Returns the value of attribute result.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #human_time ⇒ Object
-
#initialize(path, args, time, backtrace = [], result = nil) ⇒ RequestResult
constructor
A new instance of RequestResult.
- #valid_hash?(secret_key, possible_hash) ⇒ Boolean
Methods included from FilteredBacktrace
#backtrace, backtrace_regexp, #filtered_backtrace, #has_backtrace?, root_for_backtrace_filtering
Constructor Details
#initialize(path, args, time, backtrace = [], result = nil) ⇒ RequestResult
Returns a new instance of RequestResult.
9 10 11 12 13 14 15 |
# File 'lib/rack/insight/panels/active_resource_panel/query.rb', line 9 def initialize(path, args, time, backtrace = [], result=nil) @path = path @args = args @time = time @backtrace = backtrace @result = result end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
6 7 8 |
# File 'lib/rack/insight/panels/active_resource_panel/query.rb', line 6 def args @args end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/rack/insight/panels/active_resource_panel/query.rb', line 6 def path @path end |
#result ⇒ Object (readonly) Also known as: results
Returns the value of attribute result.
6 7 8 |
# File 'lib/rack/insight/panels/active_resource_panel/query.rb', line 6 def result @result end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/rack/insight/panels/active_resource_panel/query.rb', line 6 def time @time end |
Instance Method Details
#human_time ⇒ Object
17 18 19 |
# File 'lib/rack/insight/panels/active_resource_panel/query.rb', line 17 def human_time "%.2fms" % (@time) end |
#valid_hash?(secret_key, possible_hash) ⇒ Boolean
21 22 23 24 |
# File 'lib/rack/insight/panels/active_resource_panel/query.rb', line 21 def valid_hash?(secret_key, possible_hash) hash = Digest::SHA1.hexdigest [secret_key, @sql].join(":") possible_hash == hash end |