Class: AWS::Policy::ConditionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/policy.rb

Overview

Convenient syntax for adding conditions to a statement.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conditionsArray (readonly)

Returns an array of policy conditions.

Returns:

  • (Array)

    Returns an array of policy conditions.



185
186
187
# File 'lib/aws/policy.rb', line 185

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)

Returns:



197
198
199
200
201
202
203
204
# File 'lib/aws/policy.rb', line 197

def where(key, operator = nil, *values)
  if operator
    @conditions.add(operator, key, *values)
    self
  else
    OperatorBuilder.new(self, key)
  end
end