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.



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

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

Instance Method Details

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



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

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

#violationsObject



28
29
30
# File 'lib/cfn-nag/jmes_path_evaluator.rb', line 28

def violations
  @warnings + @failures
end

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



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

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