Class: Aclatraz::Suspect::SemanticRoles::Not

Inherits:
Base
  • Object
show all
Defined in:
lib/aclatraz/suspect.rb

Overview

Yes

Constant Summary

Constants inherited from Base

Base::ROLE_FORMAT

Constants inherited from Roles

Roles::ACL_ROLE_SUFFIXES

Instance Attribute Summary

Attributes inherited from Roles

#suspect

Instance Method Summary collapse

Methods inherited from Base

#method_missing

Methods inherited from Roles

#all, #assign, #delete, #has?, #initialize

Constructor Details

This class inherits a constructor from Aclatraz::Suspect::Roles

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aclatraz::Suspect::SemanticRoles::Base

Instance Method Details

#reader(*args, &blk) ⇒ Object

Check if specified suspect have assigned given role. If don’t, then given block will be executed and true returned.



133
134
135
136
137
# File 'lib/aclatraz/suspect.rb', line 133

def reader(*args, &blk)
  authorized = has?(*args)
  blk.call if !authorized && block_given?
  !authorized
end

#writer(*args) ⇒ Object

Deletes given role from suspected object.



127
128
129
# File 'lib/aclatraz/suspect.rb', line 127

def writer(*args)
  delete(*args)
end