Sha256: a21f2ae83b4ca089faa9dfd2802ba7d8355cb222eacaf6f956ade2bfa0e1a57c
Contents?: true
Size: 647 Bytes
Versions: 12
Compression:
Stored size: 647 Bytes
Contents
# Encapsulates helper methods and instance variables to be rendered in the ERB templates. class Lono::Template class Context include Lono::Template::Helper include Loader 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
12 entries across 12 versions & 1 rubygems