Sha256: 8d35e31c1e8a8b85484b6861f4894214efa8d98916a045014f1c74c5df156dd2

Contents?: true

Size: 710 Bytes

Versions: 3

Compression:

Stored size: 710 Bytes

Contents

module CanTango
  class Ability
    module Executor
      class CachedMode < Base
        include CanTango::Ability::CacheHelpers

        # FIX! no reason for double cache check!
        def cached?
          @rules = cached_rules if cached_rules? && caching_on?
        end

       def cache
          @cache ||= cache_class.new self, :cache_key => cache_key, :key_method_names => key_method_names
        end

        protected

        def cache_class
          CanTango::Ability::Cache
        end

        def start_execute
          debug "Executing cached ability"
        end

        def end_execute
          cache_rules! if caching_on?
          debug "DONE"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cantango-core-0.1.2 lib/cantango/ability/executor/cache_mode.rb
cantango-core-0.1.1 lib/cantango/ability/executor/cache_mode.rb
cantango-core-0.1.0 lib/cantango/ability/executor/cache_mode.rb