class Authorization::DevelopmentSupport::ChangeSupporter::ApproachChecker

Attributes

failed_tests[R]
users[R]

Public Class Methods

new(analyzer, tests) click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 96
def initialize (analyzer, tests)
  @analyzer, @tests = analyzer, tests
end

Public Instance Methods

assert(ok) click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 111
def assert (ok)
  @failed_tests << Test.new(*([!@current_permit_result] + @current_test_args)) unless ok
  @ok &&= ok
end
check(engine, users) click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 100
def check (engine, users)
  @current_engine = engine
  @failed_tests = []
  @current_test_args = nil
  @current_permit_result = nil
  @users = users
  @ok = true
  instance_eval(&@tests)
  @ok
end
permit?(*args) click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 116
def permit? (*args)
  @current_test_args = args
  @current_permit_result = @current_engine.permit?(
      *(args[0...-1] + [args.last.merge(:skip_attribute_test => true)]))
end