Class: AWS::Core::Policy::ConditionBuilder
- Inherits:
-
Object
- Object
- AWS::Core::Policy::ConditionBuilder
- Defined in:
- lib/aws/core/policy.rb
Overview
Convenient syntax for adding conditions to a statement.
Instance Attribute Summary collapse
-
#conditions ⇒ Array
readonly
Returns an array of policy conditions.
Instance Method Summary collapse
-
#where(key, operator = nil, *values) ⇒ OperatorBuilder
Adds a condition for the given key.
Instance Attribute Details
#conditions ⇒ Array (readonly)
Returns an array of policy conditions.
186 187 188 |
# File 'lib/aws/core/policy.rb', line 186 def conditions @conditions end |
Instance Method Details
#where(key, operator = nil, *values) ⇒ OperatorBuilder
Adds a condition for the given key. For example:
policy.allow(...).where(:current_time).lte(Date.today + 1)
198 199 200 201 202 203 204 205 |
# File 'lib/aws/core/policy.rb', line 198 def where(key, operator = nil, *values) if operator @conditions.add(operator, key, *values) self else OperatorBuilder.new(self, key) end end |