lib/tram/policy.rb in tram-policy-0.2.1 vs lib/tram/policy.rb in tram-policy-0.2.2

- old
+ new

@@ -33,19 +33,29 @@ # def [](*args) new(*args) end - private - + # Translation scope for a policy + # + # @return [Array<String>] + # def scope @scope ||= ["tram-policy", *Inflector.underscore(name)] end + # List of validators defined by a policy per se + # + # @return [Array<Proc>] + # def local @local ||= [] end + # List of all applicable validators from both the policy and its parent + # + # @return [Array<Proc>] + # def all (((self == Tram::Policy) ? [] : superclass.send(:all)) + local).uniq end end