Class: Lono::Template::Context
- Inherits:
-
Object
- Object
- Lono::Template::Context
- Extended by:
- Memoist
- 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
-
#initialize(blueprint, options = {}) ⇒ Context
constructor
A new instance of Context.
-
#instance_variables!(variables) ⇒ Object
Take a hash and makes them instance variables in the current scope.
Methods included from Helpers
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, ={}) @blueprint, @options = blueprint, 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 |