Class: CferExt::AWS::IAM::PolicyGenerator

Inherits:
Cfer::BlockHash show all
Defined in:
lib/cferext/aws/iam/policy_generator.rb

Constant Summary

Constants inherited from Cfer::BlockHash

Cfer::BlockHash::NON_PROXIED_METHODS

Instance Method Summary collapse

Methods inherited from Cfer::BlockHash

#get_property, #method_missing, #properties, #respond_to?

Methods inherited from Cfer::Block

#build_from_block, #build_from_file, #build_from_string, #include_file, #post_block, #pre_block

Constructor Details

#initializePolicyGenerator

Returns a new instance of PolicyGenerator.



7
8
9
10
# File 'lib/cferext/aws/iam/policy_generator.rb', line 7

def initialize
  self[:Version] = '2012-10-17'
  self[:Statement] = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cfer::BlockHash

Instance Method Details

#allow(&block) ⇒ Object



19
20
21
# File 'lib/cferext/aws/iam/policy_generator.rb', line 19

def allow(&block)
  statement Effect: :Allow, &block
end

#deny(&block) ⇒ Object



23
24
25
# File 'lib/cferext/aws/iam/policy_generator.rb', line 23

def deny(&block)
  statement Effect: :Deny, &block
end

#statement(options = {}, &block) ⇒ Object



12
13
14
15
16
17
# File 'lib/cferext/aws/iam/policy_generator.rb', line 12

def statement(options = {}, &block)
  statement = ::Cfer::BlockHash.new(&block)
  statement.merge! options
  statement.build_from_block(&block)
  self[:Statement].unshift statement
end