Class: Statement
- Inherits:
-
Object
- Object
- Statement
- Defined in:
- lib/cfn-model/model/statement.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#effect ⇒ Object
Returns the value of attribute effect.
-
#not_actions ⇒ Object
Returns the value of attribute not_actions.
-
#not_principal ⇒ Object
Returns the value of attribute not_principal.
-
#not_resources ⇒ Object
Returns the value of attribute not_resources.
-
#principal ⇒ Object
Returns the value of attribute principal.
-
#resources ⇒ Object
Returns the value of attribute resources.
-
#sid ⇒ Object
Returns the value of attribute sid.
Instance Method Summary collapse
- #==(another_statement) ⇒ Object
-
#initialize ⇒ Statement
constructor
A new instance of Statement.
- #wildcard_actions ⇒ Object
- #wildcard_principal? ⇒ Boolean
- #wildcard_resources ⇒ Object
Constructor Details
#initialize ⇒ Statement
Returns a new instance of Statement.
11 12 13 14 15 16 |
# File 'lib/cfn-model/model/statement.rb', line 11 def initialize @actions = [] @not_actions = [] @resources = [] @not_resources = [] end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
7 8 9 |
# File 'lib/cfn-model/model/statement.rb', line 7 def actions @actions end |
#condition ⇒ Object
Returns the value of attribute condition.
6 7 8 |
# File 'lib/cfn-model/model/statement.rb', line 6 def condition @condition end |
#effect ⇒ Object
Returns the value of attribute effect.
6 7 8 |
# File 'lib/cfn-model/model/statement.rb', line 6 def effect @effect end |
#not_actions ⇒ Object
Returns the value of attribute not_actions.
7 8 9 |
# File 'lib/cfn-model/model/statement.rb', line 7 def not_actions @not_actions end |
#not_principal ⇒ Object
Returns the value of attribute not_principal.
9 10 11 |
# File 'lib/cfn-model/model/statement.rb', line 9 def not_principal @not_principal end |
#not_resources ⇒ Object
Returns the value of attribute not_resources.
8 9 10 |
# File 'lib/cfn-model/model/statement.rb', line 8 def not_resources @not_resources end |
#principal ⇒ Object
Returns the value of attribute principal.
9 10 11 |
# File 'lib/cfn-model/model/statement.rb', line 9 def principal @principal end |
#resources ⇒ Object
Returns the value of attribute resources.
8 9 10 |
# File 'lib/cfn-model/model/statement.rb', line 8 def resources @resources end |
#sid ⇒ Object
Returns the value of attribute sid.
6 7 8 |
# File 'lib/cfn-model/model/statement.rb', line 6 def sid @sid end |
Instance Method Details
#==(another_statement) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cfn-model/model/statement.rb', line 30 def ==(another_statement) @effect == another_statement.effect && @actions == another_statement.actions && @not_actions == another_statement.not_actions && @resources == another_statement.resources && @not_resources == another_statement.not_resources && @principal == another_statement.principal && @not_principal == another_statement.not_principal && @condition == another_statement.condition end |
#wildcard_actions ⇒ Object
18 19 20 |
# File 'lib/cfn-model/model/statement.rb', line 18 def wildcard_actions @actions.select { |action| action.to_s == '*' || action.to_s =~ /^.+:\*$/ } end |
#wildcard_principal? ⇒ Boolean
22 23 24 |
# File 'lib/cfn-model/model/statement.rb', line 22 def wildcard_principal? Principal.wildcard? @principal end |
#wildcard_resources ⇒ Object
26 27 28 |
# File 'lib/cfn-model/model/statement.rb', line 26 def wildcard_resources @resources.select { |resource| resource.to_s == '*' } end |