Class: ERBContext

Inherits:
Object
  • Object
show all
Defined in:
lib/nub/core.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ ERBContext

Creates an isolated ERB variable context easily from a hash

Parameters:

  • hash (Hash)

    variables to use for ERB context



42
43
44
# File 'lib/nub/core.rb', line 42

def initialize(hash)
  hash.each{|k,v| singleton_class.send(:define_method, k){ v }}
end

Instance Method Details

#get_bindingObject



46
47
48
# File 'lib/nub/core.rb', line 46

def get_binding
  binding
end