Sha256: c0b300efbb7746ad0ea2d5f9b2d9ad629e1f4da8371d41a668c0e2b187b8aee0
Contents?: true
Size: 731 Bytes
Versions: 11
Compression:
Stored size: 731 Bytes
Contents
# Encapsulates helper methods and instance variables to be rendered in the ERB templates. class Lono::Template class Context extend Memoist include Lono::Template::Helper include Loader include Helpers # ERB include Dsl::Builder::Syntax # DSL def initialize(blueprint, options={}) @blueprint, @options = blueprint, options load_variables load_project_helpers end # 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. def instance_variables!(variables) variables.each do |key, value| instance_variable_set('@' + key.to_s, value) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems