Class: Gluez::Vars

Inherits:
Object
  • Object
show all
Defined in:
lib/gluez/erb/vars.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Vars

Returns a new instance of Vars.



3
4
5
6
7
8
9
# File 'lib/gluez/erb/vars.rb', line 3

def initialize(hash={})
  hash.each_pair do |key, val|
    self.metaclass.send(:define_method, key) do
      val
    end
  end
end

Instance Method Details

#get_bindingObject



15
16
17
# File 'lib/gluez/erb/vars.rb', line 15

def get_binding
  binding
end

#metaclassObject



11
12
13
# File 'lib/gluez/erb/vars.rb', line 11

def metaclass
  class << self; self; end
end