class AWS::Core::Policy::ConditionBuilder
Convenient syntax for adding conditions to a statement. @see Policy#allow
@see Policy#deny
Attributes
conditions[R]
@return [Array] Returns an array of policy conditions.
Public Class Methods
new(conditions)
click to toggle source
@private
# File lib/aws/core/policy.rb, line 189 def initialize(conditions) @conditions = conditions end
Public Instance Methods
where(key, operator = nil, *values)
click to toggle source
Adds a condition for the given key. For example:
policy.allow(...).where(:current_time).lte(Date.today + 1)
@return [OperatorBuilder]
# 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