class RuleDefinition

Constants

FAILING_VIOLATION
WARNING

Attributes

id[R]
message[R]
type[R]

Public Class Methods

new(id:, type:, message:) click to toggle source
# File lib/cfn-nag/rule_definition.rb, line 9
def initialize(id:,
               type:,
               message:)
  @id = id
  @type = type
  @message = message

  [@id, @type, @message].each do |required|
    raise 'No parameters to Violation constructor can be nil' if required.nil?
  end
end

Public Instance Methods

==(other) click to toggle source
# File lib/cfn-nag/rule_definition.rb, line 33
def ==(other)
  other.class == self.class && other.to_h == to_h
end
to_h() click to toggle source
# File lib/cfn-nag/rule_definition.rb, line 25
def to_h
  {
    id: @id,
    type: @type,
    message: @message
  }
end
to_s() click to toggle source
# File lib/cfn-nag/rule_definition.rb, line 21
def to_s
  "#{@id} #{@type} #{@message}"
end