Class: Tuersteher::PathSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/tuersteher.rb

Overview

The Classes for the separate Rule-Specifications

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject

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

Returns:

  • (Boolean)


414
415
416
417
418
# File 'lib/tuersteher.rb', line 414

def grant? path_or_model, method, 
  rc = @path_regex =~ path_or_model
  rc = !rc if @negation
  rc
end

#to_sObject



420
421
422
# File 'lib/tuersteher.rb', line 420

def to_s
  "#{@negation && 'not.'}path('#{@path}')"
end