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

- (ERBContext) initialize(variables = {})

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

- (Binding) get_binding

Returns:

  • (Binding)


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

def get_binding
  return binding
end