Module: Ramaze::CoreExtensions::Proc
- Defined in:
- lib/ramaze/snippets/proc/locals.rb
Overview
Extensions for Proc
Instance Method Summary collapse
-
#locals ⇒ Object
returns a hash of localvar/localvar-values from proc, useful for template engines that do not accept bindings/proc and force passing locals via hash usage: x = 42; p Proc.new.locals #=> 42.
Instance Method Details
#locals ⇒ Object
returns a hash of localvar/localvar-values from proc, useful for template engines that do not accept bindings/proc and force passing locals via hash
usage: x = 42; p Proc.new.locals #=> {'x'=> 42}
13 14 15 |
# File 'lib/ramaze/snippets/proc/locals.rb', line 13 def locals instance_eval('binding').locals end |