blob: ca2eb98e3e80a042f92f2ebffc83e5c74cecdb7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
module DeclarativePolicy
# Used when the name of a delegate is mentioned in
# the rule DSL.
class DelegateDsl
def initialize(rule_dsl, delegate_name)
@rule_dsl = rule_dsl
@delegate_name = delegate_name
end
def method_missing(msg, *args)
return super unless args.empty? && !block_given?
@rule_dsl.delegate(@delegate_name, msg)
end
end
end
|