Class: Lono::Template::Context

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
Helpers, Loader, Helper
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

Instance Method Summary collapse

Methods included from Helpers

#ssm, #ssm_fetcher

Methods included from Helper

#current_region, #extract_scripts, #indent, #partial, #partial_exist?, #scripts_name, #scripts_s3_path, #template_params, #template_s3_path, #user_data

Constructor Details

#initialize(blueprint, options = {}) ⇒ Context

Returns a new instance of Context.



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

def initialize(blueprint, options={})
  @blueprint, @options = blueprint, options
  load_variables
  load_project_helpers
end

Instance Method Details

#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