Sha256: a041c536710031a07ebdcffb7d7a20e9b92714e5c4f16317fc30731eed3ef28f
Contents?: true
Size: 480 Bytes
Versions: 6
Compression:
Stored size: 480 Bytes
Contents
module Abilities class Proxy def initialize(actor, definitions, &block) @actor = actor @definitions = definitions instance_eval &block end def can(actions, subjects, &block) @definitions.add actions, subjects, true, &block end def cannot(actions, subjects, &block) @definitions.add actions, subjects, false, &block end def method_missing(name, *args, &block) @actor.send name, *args, &block end end end
Version data entries
6 entries across 6 versions & 1 rubygems