Class: AWS::Policy::OperatorBuilder

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



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

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