Class: CanTango::Ability::Cache::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/ability/cache/reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache) ⇒ Reader

Returns a new instance of Reader.



7
8
9
# File 'lib/cantango/ability/cache/reader.rb', line 7

def initialize cache
  @cache = cache
end

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



5
6
7
# File 'lib/cantango/ability/cache/reader.rb', line 5

def cache
  @cache
end

Instance Method Details

#prepared_rulesObject



11
12
13
# File 'lib/cantango/ability/cache/reader.rb', line 11

def prepared_rules
  cache.compile_on? ? compiler.decompile!(loaded_rules) : loaded_rules
end