Class: Memcacheable::FetchAssociation
- Defined in:
- lib/memcacheable/fetch_association.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#association ⇒ Object
Returns the value of attribute association.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #cache_key ⇒ Object
- #class_name ⇒ Object
- #description ⇒ Object
-
#initialize(object, association) ⇒ FetchAssociation
constructor
A new instance of FetchAssociation.
Methods inherited from Fetcher
Constructor Details
#initialize(object, association) ⇒ FetchAssociation
Returns a new instance of FetchAssociation.
5 6 7 8 |
# File 'lib/memcacheable/fetch_association.rb', line 5 def initialize(object, association) self.object = object self.association = association end |
Instance Attribute Details
#association ⇒ Object
Returns the value of attribute association.
3 4 5 |
# File 'lib/memcacheable/fetch_association.rb', line 3 def association @association end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/memcacheable/fetch_association.rb', line 3 def object @object end |
Instance Method Details
#cache_key ⇒ Object
10 11 12 |
# File 'lib/memcacheable/fetch_association.rb', line 10 def cache_key [object, association] end |
#class_name ⇒ Object
14 15 16 |
# File 'lib/memcacheable/fetch_association.rb', line 14 def class_name object.class.name.downcase end |
#description ⇒ Object
18 19 20 |
# File 'lib/memcacheable/fetch_association.rb', line 18 def description "#{association} for #{class_name} #{object.id}" end |