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::OperatorBuilder

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

Overview

Convenient syntax for expressing operators in statement condition blocks. For example, the following:

policy.allow.where(:s3_prefix).not("forbidden").
  where(:current_time).lte(Date.today+1)

is equivalent to:

conditions = Policy::ConditionBlock.new
conditions.add(:not, :s3_prefix, "forbidden")
conditions.add(:lte, :current_time, Date.today+1)
policy.allow(:conditions => conditions)

See Also:

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *values) ⇒ Object

[View source]

171
172
173
174
# File 'lib/aws/core/policy.rb', line 171

def method_missing(m, *values)
  @condition_builder.conditions.add(m, @key, *values)
  @condition_builder
end