Class: Jets::Cfn::TemplateBuilders::IamPolicy::FunctionPolicy

Inherits:
BasePolicy
  • Object
show all
Defined in:
lib/jets/cfn/template_builders/iam_policy/function_policy.rb

Instance Attribute Summary

Attributes inherited from BasePolicy

#definitions

Instance Method Summary collapse

Methods inherited from BasePolicy

#classify_name, #policy_document, #setup, #standardize

Constructor Details

#initialize(task) ⇒ FunctionPolicy

Returns a new instance of FunctionPolicy.



7
8
9
10
11
12
13
14
# File 'lib/jets/cfn/template_builders/iam_policy/function_policy.rb', line 7

def initialize(task)
  setup
  @task = task
  @app_class = task.class_name.to_s
  # IE: @app_class: PostsController, HardJob, Hello, HelloFunction

  @definitions = task.iam_policy || [] # iam_policy contains definitions
end

Instance Method Details

#policy_nameObject

Example: PostsControllerIndexPolicy or SleepJobPerformPolicy



17
18
19
# File 'lib/jets/cfn/template_builders/iam_policy/function_policy.rb', line 17

def policy_name
  classify_name("#{@app_class}_#{@task.meth}_policy")
end