Merb::Cache::ActionStore

Store well suited for action caching.

Public Instance Methods

delete(dispatch, parameters = {}) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 42
42:     def delete(dispatch, parameters = {})
43:       if writable?(dispatch, parameters)
44:         @stores.map {|s| s.delete(normalize(dispatch), parameters)}.any?
45:       end
46:     end
delete_all!() click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 48
48:     def delete_all!
49:       @stores.map {|s| s.delete_all!}.all?
50:     end
exists?(dispatch, parameters = {}) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 36
36:     def exists?(dispatch, parameters = {})
37:       if writable?(dispatch, parameters)
38:         @stores.capture_first {|s| s.exists?(normalize(dispatch), parameters)}
39:       end
40:     end
fetch(dispatch, parameters = {}, conditions = {}, &blk) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 30
30:     def fetch(dispatch, parameters = {}, conditions = {}, &blk)
31:       if writable?(dispatch, parameters, conditions)
32:         read(dispatch, parameters) || @stores.capture_first {|s| s.fetch(normalize(dispatch), data || dispatch.body, parameters, conditions, &blk)}
33:       end
34:     end
normalize(dispatch) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 52
52:     def normalize(dispatch)
53:       "#{dispatch.class.name}##{dispatch.action_name}" unless dispatch.class.name.blank? || dispatch.action_name.blank?
54:     end
read(dispatch, parameters = {}) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 12
12:     def read(dispatch, parameters = {})
13:       if writable?(dispatch, parameters)
14:         @stores.capture_first {|s| s.read(normalize(dispatch), parameters)}
15:       end
16:     end
writable?(dispatch, parameters = {}, conditions = {}) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 4
 4:     def writable?(dispatch, parameters = {}, conditions = {})
 5:       case dispatch
 6:       when Merb::Controller
 7:         @stores.any?{|s| s.writable?(normalize(dispatch), parameters, conditions)}
 8:       else false
 9:       end
10:     end
write(dispatch, data = nil, parameters = {}, conditions = {}) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 18
18:     def write(dispatch, data = nil, parameters = {}, conditions = {})
19:       if writable?(dispatch, parameters, conditions)
20:         @stores.capture_first {|s| s.write(normalize(dispatch), data || dispatch.body, parameters, conditions)}
21:       end
22:     end
write_all(dispatch, data = nil, parameters = {}, conditions = {}) click to toggle source
    # File lib/merb-cache/stores/strategy/action_store.rb, line 24
24:     def write_all(dispatch, data = nil, parameters = {}, conditions = {})
25:       if writable?(dispatch, parameters, conditions)
26:         @stores.map {|s| s.write_all(normalize(dispatch), data || dispatch.body, parameters, conditions)}.all?
27:       end
28:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.