Class: Lono::Template::Context

Inherits:
AbstractBase show all
Extended by:
Memoist
Includes:
Helpers, Loader, Helper, Strategy::Dsl::Builder::Syntax
Defined in:
lib/lono/template/context.rb,
lib/lono/template/context/loader.rb,
lib/lono/template/context/helpers.rb,
lib/lono/template/context/ssm_fetcher.rb

Defined Under Namespace

Modules: Helpers, Loader Classes: SsmFetcher

Constant Summary

Constants included from Strategy::Dsl::Builder::Fn

Strategy::Dsl::Builder::Fn::FUNCTIONS

Instance Method Summary collapse

Methods included from Strategy::Common::Helpers

#extract_scripts, #scripts_name, #scripts_s3_path, #setting

Methods included from Strategy::Dsl::Builder::Helpers::TagsHelper

#dimensions, #tag_list, #tags

Methods included from Strategy::Dsl::Builder::Helpers::S3Helper

#file_s3_key, #s3_bucket

Methods included from Strategy::Dsl::Builder::Helpers::LookupHelper

#lookup_output

Methods included from AwsServices

#cfn, #ec2, #iam, #s3, #s3_presigner, #s3_resource, #sts

Methods included from AwsServices::Helper

#rollback_complete?, #testing_update?

Methods included from AwsServices::StackSet

#find_stack_set, #stack_set_exists?

Methods included from AwsServices::Stack

#find_stack, #stack_exists?

Methods included from Strategy::Dsl::Builder::Helpers::FileHelper

#content, #render_file, #render_path, #user_data, #user_data_script

Methods included from Strategy::Dsl::Builder::Helpers::CoreHelper

#setting, #stack_name

Methods included from Strategy::Dsl::Builder::Syntax::ExtendWith

#extend_with

Methods included from Strategy::Dsl::Builder::Syntax::ParameterGroup

#parameter_group

Methods included from Strategy::Dsl::Builder::Section::Methods

#aws_template_format_version, #condition, #description, #mapping, #metadata, #output, #parameter, #resource, #section, #transform

Methods included from Evaluate

#evaluate_template_path, #template_evaluation_error

Methods included from Strategy::Dsl::Builder::Fn

#conditional_ref, define_methods, #fn, #fn_id, #get_att, #get_azs, included, #join, #ref, #sub

Methods included from Helpers

#ssm, #ssm_fetcher

Methods included from Loader::LoadFiles

#load_files

Methods included from Helper

#current_region, #indent, #partial, #partial_exist?, #template_params, #template_s3_path, #user_data

Methods inherited from AbstractBase

#reinitialize, #template_path

Methods included from Blueprint::Root

#find_blueprint_root, #set_blueprint_root

Constructor Details

#initialize(options = {}) ⇒ Context

Returns a new instance of Context.



10
11
12
13
# File 'lib/lono/template/context.rb', line 10

def initialize(options={})
  super
  load_context
end

Instance Method Details

#get_bindingObject

For Lono::AppFile::Build usage of Thor::Action directory For some reason a send(:binding) doesnt work but get_binding like this works.



25
26
27
# File 'lib/lono/template/context.rb', line 25

def get_binding
  binding
end

#instance_variables!(variables) ⇒ Object

Take a hash and makes them instance variables in the current scope. Use this in custom helper methods to make variables accessible to ERB templates.



17
18
19
20
21
# File 'lib/lono/template/context.rb', line 17

def instance_variables!(variables)
  variables.each do |key, value|
    instance_variable_set('@' + key.to_s, value)
  end
end