Sha256: 95d1da98824c667e79d7435940ecd72d51fa22d9f6c70496ba6e7e6d291877be
Contents?: true
Size: 441 Bytes
Versions: 4
Compression:
Stored size: 441 Bytes
Contents
module IAmICan module Permission class PArray < ::Array attr_accessor :pms def matched?(pms_name) return false if self.blank? self.pms = pms_name.to_sym found? || covered? end def found? pms.in? self end def covered? pred, obj_type, obj_id = pms.to_s.split('_') pred.to_sym.in?(self) || :"#{pred}_#{obj_type}".in?(self) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems