Class: Ultracache::Relationship

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracache/relationship.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Relationship

Returns a new instance of Relationship.



5
6
7
8
9
# File 'lib/ultracache/relationship.rb', line 5

def initialize(name, options={})
  @name = name
  @self_class = options[:self_class].to_s
  @associated_class = options[:associated_class].to_s
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/ultracache/relationship.rb', line 3

def name
  @name
end

Instance Method Details

#associated_classObject



15
16
17
# File 'lib/ultracache/relationship.rb', line 15

def associated_class
  @associated_class.camelize.constantize
end

#destroy_cache(obj) ⇒ Object



21
# File 'lib/ultracache/relationship.rb', line 21

def destroy_cache(obj); end

#read_cache(obj, options = {}) ⇒ Object



19
# File 'lib/ultracache/relationship.rb', line 19

def read_cache(obj, options = {}); end

#save_cache(obj) ⇒ Object



20
# File 'lib/ultracache/relationship.rb', line 20

def save_cache(obj); end

#self_classObject



11
12
13
# File 'lib/ultracache/relationship.rb', line 11

def self_class
  @self_class.camelize.constantize
end

#update_cache(obj) ⇒ Object



22
# File 'lib/ultracache/relationship.rb', line 22

def update_cache(obj); end