Class: Authorization::DevelopmentSupport::ChangeAnalyzer::ApproachChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/declarative_authorization/development_support/change_analyzer.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ApproachChecker) initialize(analyzer, tests)



72
73
74
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 72

def initialize (analyzer, tests)
  @analyzer, @tests = analyzer, tests
end

Instance Attribute Details

- (Object) failed_test_count (readonly)

Returns the value of attribute failed_test_count



70
71
72
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 70

def failed_test_count
  @failed_test_count
end

- (Object) users (readonly)

Returns the value of attribute users



70
71
72
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 70

def users
  @users
end

Instance Method Details

- (Object) assert(ok)



85
86
87
88
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 85

def assert (ok)
  @failed_test_count += 1 unless ok
  @ok &&= ok
end

- (Object) check(engine, users)



76
77
78
79
80
81
82
83
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 76

def check (engine, users)
  @current_engine = engine
  @failed_test_count = 0
  @users = users
  @ok = true
  instance_eval(&@tests)
  @ok
end

- (Boolean) permit?(*args)



90
91
92
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 90

def permit? (*args)
  @current_engine.permit?(*args)
end