Module: ActionPolicy::Policy::Cache::ClassMethods
- Defined in:
- lib/action_policy/policy/cache.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#cache(*rules, **options) ⇒ Object
83 84 85 86 87 |
# File 'lib/action_policy/policy/cache.rb', line 83 def cache(*rules, **) rules.each do |rule| cached_rules[rule] = end end |
#cached_rules ⇒ Object
89 90 91 92 93 94 95 96 97 |
# File 'lib/action_policy/policy/cache.rb', line 89 def cached_rules return @cached_rules if instance_variable_defined?(:@cached_rules) @cached_rules = if superclass.respond_to?(:cached_rules) superclass.cached_rules.dup else {} end end |