Class: CIAT::TemplateBinder

Inherits:
Object
  • Object
show all
Includes:
ERBHelpers
Defined in:
lib/ciat/erb_helpers.rb

Overview

Assists in binding local variables for a recursive render.

Instance Method Summary collapse

Methods included from ERBHelpers

#light_to_sentence, #light_to_word, #new_path?, #render, #replace_tabs, #title

Constructor Details

#initialize(locals) ⇒ TemplateBinder

Returns a new instance of TemplateBinder.



74
75
76
77
78
# File 'lib/ciat/erb_helpers.rb', line 74

def initialize(locals)
  locals.each do |variable, value|
    self.class.send(:define_method, variable, Proc.new {value})
  end
end

Instance Method Details

#get_bindingObject



80
81
82
# File 'lib/ciat/erb_helpers.rb', line 80

def get_binding
  binding
end