Class: ERBContext
- Inherits:
-
Object
- Object
- ERBContext
- Defined in:
- lib/nub/core.rb
Instance Method Summary collapse
- #get_binding ⇒ Object
-
#initialize(hash) ⇒ ERBContext
constructor
Creates an isolated ERB variable context easily from a hash.
Constructor Details
#initialize(hash) ⇒ ERBContext
Creates an isolated ERB variable context easily from a hash
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_binding ⇒ Object
46 47 48 |
# File 'lib/nub/core.rb', line 46 def get_binding binding end |