Class: LL::ERBContext

Inherits:
Object
  • Object
show all
Defined in:
lib/ll/erb_context.rb

Overview

A context for a single ERB template, used for storing variables and retrieving the binding for a template.

Instance Method Summary collapse

Constructor Details

#initialize(variables = {}) ⇒ ERBContext

Returns a new instance of ERBContext.

Parameters:

  • variables (Hash) (defaults to: {})


10
11
12
13
14
# File 'lib/ll/erb_context.rb', line 10

def initialize(variables = {})
  variables.each do |name, value|
    instance_variable_set("@#{name}", value)
  end
end

Instance Method Details

#get_bindingBinding

Returns:

  • (Binding)


19
20
21
# File 'lib/ll/erb_context.rb', line 19

def get_binding
  return binding
end