Class: Lono::Template::Context
- Inherits:
-
Object
- Object
- Lono::Template::Context
- Includes:
- Helper
- Defined in:
- lib/lono/template/context.rb
Instance Method Summary collapse
-
#initialize(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 Helper
#check_s3_folder_settings!, #current_region, #extract_scripts, #file_s3_key, #indent, #partial, #partial_exist?, #scripts_name, #scripts_s3_path, #template_params, #template_s3_path, #user_data
Constructor Details
#initialize(options = {}) ⇒ Context
Returns a new instance of Context.
7 8 9 10 11 |
# File 'lib/lono/template/context.rb', line 7 def initialize(={}) @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.
15 16 17 18 19 |
# File 'lib/lono/template/context.rb', line 15 def instance_variables!(variables) variables.each do |key, value| instance_variable_set('@' + key.to_s, value) end end |