Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::Core::Policy::ConditionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/core/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.


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

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:

[View source]

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

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