Class: Tuersteher::MethodSpecification

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

Instance Method Summary collapse

Constructor Details

#initialize(method, negation) ⇒ MethodSpecification

Returns a new instance of MethodSpecification.



486
487
488
# File 'lib/tuersteher.rb', line 486

def initialize method, negation
  @method, @negation = method, negation
end

Instance Method Details

#grant?(path_or_model, method, login_ctx) ⇒ Boolean

Returns:

  • (Boolean)


490
491
492
493
494
# File 'lib/tuersteher.rb', line 490

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

#to_sObject



496
497
498
# File 'lib/tuersteher.rb', line 496

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