lib/reuser/reuser.rb in reuser-0.2.0 vs lib/reuser/reuser.rb in reuser-0.2.1

- old
+ new

@@ -32,38 +32,27 @@ end end end subclass.class_eval do - def role(name = nil) - if name - if @@roles[name] - @role = @@roles[name] - else - raise NoRoleError, "No role #{name} defined for #{self}" - end - end - @role - end - def role?(name) - role == self.class.role(name) + @role == self.class.role(name) end def can?(name) - !!role.can?(name) + !!@role.can?(name) end def cant?(name) - !role.can?(name) + !@role.can?(name) end def could?(name, obj) - role.could?(name, obj) + @role.could?(name, obj) end def couldnt?(name, obj) - !role.could?(name, obj) + !@role.could?(name, obj) end end end end end