Module: ResourcePolicy::Policy::ClassMethods

Defined in:
lib/resource_policy/policy.rb

Overview

Class methods.

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object



19
20
21
22
# File 'lib/resource_policy/policy.rb', line 19

def inherited(subclass)
  super
  subclass.instance_variable_set(:@policy, policy.dup)
end

#policy {|@policy| ... } ⇒ Object

Yields:



13
14
15
16
17
# File 'lib/resource_policy/policy.rb', line 13

def policy
  @policy ||= Policy::PolicyConfiguration.new
  yield(@policy) if block_given?
  @policy
end