Class: Dslh::ScopeBlock
- Inherits:
-
Object
- Object
- Dslh::ScopeBlock
- Defined in:
- lib/dslh.rb
Overview
of Scope
Class Method Summary collapse
Class Method Details
.nest(bind, block_var) ⇒ Object
207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/dslh.rb', line 207 def self.nest(bind, block_var) eval(" if \#{block_var}\n __hash_orig = @__hash__\n @__hash__ = {}\n self.instance_eval(&\#{block_var})\n __nested_hash = @__hash__\n @__hash__ = __hash_orig\n __nested_hash\n else\n nil\n end\n EOS\nend\n", bind) |