Method: Webby::Renderer#_configure_locals

Defined in:
lib/webby/renderer.rb

#_configure_locals(locals) ⇒ Object

call-seq:

_configure_locals( locals )

Configure local variables in the scope of the current binding returned by the get_binding method. The locals should be given as a hash of name / value pairs.



327
328
329
330
331
332
333
334
335
# File 'lib/webby/renderer.rb', line 327

def _configure_locals( locals )
  return if locals.nil?

  locals.each do |k,v|
    Thread.current[:value] = v
    definition = "#{k} = Thread.current[:value]"
    eval(definition, get_binding)
  end
end