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.



484
485
486
# File 'lib/tuersteher.rb', line 484

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

Instance Method Details

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

Returns:

  • (Boolean)


488
489
490
491
492
# File 'lib/tuersteher.rb', line 488

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

#to_sObject



494
495
496
# File 'lib/tuersteher.rb', line 494

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