Class: Tuersteher::PathSpecification
- Inherits:
-
Object
- Object
- Tuersteher::PathSpecification
- Defined in:
- lib/tuersteher.rb
Overview
The Classes for the separate Rule-Specifications
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #grant?(path_or_model, method, login_ctx) ⇒ Boolean
-
#initialize(path, negation) ⇒ PathSpecification
constructor
A new instance of PathSpecification.
- #to_s ⇒ Object
Constructor Details
#initialize(path, negation) ⇒ PathSpecification
Returns a new instance of PathSpecification.
398 399 400 401 |
# File 'lib/tuersteher.rb', line 398 def initialize path, negation @negation = negation self.path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
396 397 398 |
# File 'lib/tuersteher.rb', line 396 def path @path end |
Instance Method Details
#grant?(path_or_model, method, login_ctx) ⇒ Boolean
414 415 416 417 418 |
# File 'lib/tuersteher.rb', line 414 def grant? path_or_model, method, login_ctx rc = @path_regex =~ path_or_model rc = !rc if @negation rc end |
#to_s ⇒ Object
420 421 422 |
# File 'lib/tuersteher.rb', line 420 def to_s "#{@negation && 'not.'}path('#{@path}')" end |