Class: JmesPathEvaluator

Inherits:
Object
  • Object
show all
Defined in:
lib/cfn-nag/jmes_path_evaluator.rb

Overview

THIS DOES NOT RESPECT SUPPRESSIONS!!!!!!

Instance Method Summary collapse

Constructor Details

#initialize(cfn_model) ⇒ JmesPathEvaluator

Returns a new instance of JmesPathEvaluator.



10
11
12
13
14
# File 'lib/cfn-nag/jmes_path_evaluator.rb', line 10

def initialize(cfn_model)
  @cfn_model = cfn_model
  @warnings = []
  @failures = []
end

Instance Method Details

#failure(id:, jmespath:, message:) ⇒ Object



23
24
25
26
27
28
# File 'lib/cfn-nag/jmes_path_evaluator.rb', line 23

def failure(id:, jmespath:, message:)
  violation id: id,
            jmespath: jmespath,
            message: message,
            violation_type: Violation::FAILING_VIOLATION
end

#violationsObject



30
31
32
# File 'lib/cfn-nag/jmes_path_evaluator.rb', line 30

def violations
  @warnings + @failures
end

#warning(id:, jmespath:, message:) ⇒ Object



16
17
18
19
20
21
# File 'lib/cfn-nag/jmes_path_evaluator.rb', line 16

def warning(id:, jmespath:, message:)
  violation id: id,
            jmespath: jmespath,
            message: message,
            violation_type: Violation::WARNING
end