Sha256: b59eb9306770240e6a1e8b2eef0650118faae56d3f6a677e730674e4a024fd52

Contents?: true

Size: 627 Bytes

Versions: 7

Compression:

Stored size: 627 Bytes

Contents

module CanTango
  class Ability
    class Cache
      class Reader
        include CanTango::Helpers::Debug

        attr_reader :cache

        def initialize cache
          @cache = cache
        end

        def prepared_rules
          debug "reading rules from cache: #{cache.key}"
          cache.compile_on? ? compiler.decompile!(loaded_rules) : loaded_rules
        end

        protected

        def loaded_rules
          rules_cache.load(cache.key)
        end

        def compiler
          cache.compiler
        end

        def rules_cache
          cache.rules_cache
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/ability/cache/reader.rb
cantango-0.9.4.6 lib/cantango/ability/cache/reader.rb
cantango-0.9.4.5 lib/cantango/ability/cache/reader.rb
cantango-0.9.4.3 lib/cantango/ability/cache/reader.rb
cantango-0.9.4.2 lib/cantango/ability/cache/reader.rb
cantango-0.9.4.1 lib/cantango/ability/cache/reader.rb
cantango-0.9.4 lib/cantango/ability/cache/reader.rb