Class: Rack::Insight::CachePanel::Stats::Query
- Inherits:
-
Object
- Object
- Rack::Insight::CachePanel::Stats::Query
- Defined in:
- lib/rack/insight/panels/cache_panel/stats.rb
Instance Attribute Summary collapse
-
#hit ⇒ Object
readonly
Returns the value of attribute hit.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #display_keys ⇒ Object
- #display_time ⇒ Object
-
#initialize(method, time, hit, keys) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(method, time, hit, keys) ⇒ Query
Returns a new instance of Query.
8 9 10 11 12 13 |
# File 'lib/rack/insight/panels/cache_panel/stats.rb', line 8 def initialize(method, time, hit, keys) @method = method @time = time @hit = hit @keys = keys end |
Instance Attribute Details
#hit ⇒ Object (readonly)
Returns the value of attribute hit.
6 7 8 |
# File 'lib/rack/insight/panels/cache_panel/stats.rb', line 6 def hit @hit end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
6 7 8 |
# File 'lib/rack/insight/panels/cache_panel/stats.rb', line 6 def keys @keys end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/rack/insight/panels/cache_panel/stats.rb', line 6 def method @method end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/rack/insight/panels/cache_panel/stats.rb', line 6 def time @time end |
Instance Method Details
#display_keys ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/rack/insight/panels/cache_panel/stats.rb', line 19 def display_keys if keys.size == 1 keys.first else keys.join(", ") end end |
#display_time ⇒ Object
15 16 17 |
# File 'lib/rack/insight/panels/cache_panel/stats.rb', line 15 def display_time "%.2fms" % time end |