Class: JmesPathEvaluator

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

Instance Method Summary collapse

Constructor Details

#initialize(cfn_model) ⇒ JmesPathEvaluator

Returns a new instance of JmesPathEvaluator.



5
6
7
8
9
# File 'lib/cfn-nag/jmes_path_evaluator.rb', line 5

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

Instance Method Details

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



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

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

#violationsObject



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

def violations
  @warnings + @failures
end

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



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

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