Class: Memcacheable::FetchMethod
- Defined in:
- lib/memcacheable/fetch_method.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#method ⇒ Object
Returns the value of attribute method.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #cache_key ⇒ Object
- #description ⇒ Object
- #find_on_cache_miss ⇒ Object
-
#initialize(object, method, args) ⇒ FetchMethod
constructor
A new instance of FetchMethod.
Methods inherited from Fetcher
Constructor Details
#initialize(object, method, args) ⇒ FetchMethod
Returns a new instance of FetchMethod.
5 6 7 8 9 |
# File 'lib/memcacheable/fetch_method.rb', line 5 def initialize(object, method, args) self.object = object self.method = method self.args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
3 4 5 |
# File 'lib/memcacheable/fetch_method.rb', line 3 def args @args end |
#method ⇒ Object
Returns the value of attribute method.
3 4 5 |
# File 'lib/memcacheable/fetch_method.rb', line 3 def method @method end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/memcacheable/fetch_method.rb', line 3 def object @object end |
Instance Method Details
#cache_key ⇒ Object
11 12 13 |
# File 'lib/memcacheable/fetch_method.rb', line 11 def cache_key [object, method, args] end |
#description ⇒ Object
15 16 17 |
# File 'lib/memcacheable/fetch_method.rb', line 15 def description "method #{cache_key.to_param}" end |
#find_on_cache_miss ⇒ Object
19 20 21 |
# File 'lib/memcacheable/fetch_method.rb', line 19 def find_on_cache_miss object.send method, *args end |