Class: Rack::Bug::CachePanel::Stats::Query
- Inherits:
-
Object
- Object
- Rack::Bug::CachePanel::Stats::Query
- Defined in:
- lib/rack/bug/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.
9 10 11 12 13 14 |
# File 'lib/rack/bug/panels/cache_panel/stats.rb', line 9 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.
7 8 9 |
# File 'lib/rack/bug/panels/cache_panel/stats.rb', line 7 def hit @hit end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
7 8 9 |
# File 'lib/rack/bug/panels/cache_panel/stats.rb', line 7 def keys @keys end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
7 8 9 |
# File 'lib/rack/bug/panels/cache_panel/stats.rb', line 7 def method @method end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
7 8 9 |
# File 'lib/rack/bug/panels/cache_panel/stats.rb', line 7 def time @time end |
Instance Method Details
#display_keys ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/rack/bug/panels/cache_panel/stats.rb', line 20 def display_keys if keys.size == 1 keys.first else keys.join(", ") end end |
#display_time ⇒ Object
16 17 18 |
# File 'lib/rack/bug/panels/cache_panel/stats.rb', line 16 def display_time "%.2fms" % time end |