Class: CanTango::Ability::Cache::RulesCache
- Inherits:
-
Object
- Object
- CanTango::Ability::Cache::RulesCache
- Defined in:
- lib/cantango/ability/cache/rules_cache.rb
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #cache_options ⇒ Object
- #clazz ⇒ Object
-
#initialize(session = nil) ⇒ RulesCache
constructor
A new instance of RulesCache.
- #instance ⇒ Object
- #options ⇒ Object
Constructor Details
#initialize(session = nil) ⇒ RulesCache
Returns a new instance of RulesCache.
11 12 13 |
# File 'lib/cantango/ability/cache/rules_cache.rb', line 11 def initialize session = nil @session = session end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
5 6 7 |
# File 'lib/cantango/ability/cache/rules_cache.rb', line 5 def session @session end |
Instance Method Details
#cache_options ⇒ Object
19 20 21 |
# File 'lib/cantango/ability/cache/rules_cache.rb', line 19 def cache_engine.store. || {} end |
#clazz ⇒ Object
23 24 25 |
# File 'lib/cantango/ability/cache/rules_cache.rb', line 23 def clazz cache_engine.store.default_class end |
#instance ⇒ Object
7 8 9 |
# File 'lib/cantango/ability/cache/rules_cache.rb', line 7 def instance @instance ||= clazz.new :rules_cache, end |
#options ⇒ Object
15 16 17 |
# File 'lib/cantango/ability/cache/rules_cache.rb', line 15 def @options ||= session ? .merge(:session => session) : end |