Class: RuleIdSet

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

Overview

Container class for profiles

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRuleIdSet

Returns a new instance of RuleIdSet.


9
10
11
# File 'lib/cfn-nag/rule_id_set.rb', line 9

def initialize
  @rule_ids = Set.new
end

Instance Attribute Details

#rule_idsObject (readonly)

Returns the value of attribute rule_ids


7
8
9
# File 'lib/cfn-nag/rule_id_set.rb', line 7

def rule_ids
  @rule_ids
end

Instance Method Details

#add_rule(rule_id) ⇒ Object

Add a Rule to a profile


14
15
16
# File 'lib/cfn-nag/rule_id_set.rb', line 14

def add_rule(rule_id)
  @rule_ids << rule_id
end

#contains_rule?(rule_id) ⇒ Boolean

Does the list of rule ids contain rule_id?

Returns:

  • (Boolean)

19
20
21
# File 'lib/cfn-nag/rule_id_set.rb', line 19

def contains_rule?(rule_id)
  @rule_ids.include? rule_id
end