class Lono::Template::Context

Public Class Methods

new(options={}) click to toggle source
Calls superclass method Lono::AbstractBase::new
# File lib/lono/template/context.rb, line 10
def initialize(options={})
  super
  load_context
end

Public Instance Methods

get_binding() click to toggle source

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

# File lib/lono/template/context.rb, line 25
def get_binding
  binding
end
instance_variables!(variables) click to toggle source

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.

# 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