Sha256: 3619d06fddc4d565f047c94e8859696ab0f435d1009944d6a2158ac187c116b6

Contents?: true

Size: 287 Bytes

Versions: 6

Compression:

Stored size: 287 Bytes

Contents

class Proc

  # 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}
  def locals
    instance_eval('binding').locals
  end

end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
clivecrous-ramaze-0.3.9.5 lib/ramaze/snippets/proc/locals.rb
manveru-ramaze-2008.07 lib/ramaze/snippets/proc/locals.rb
manveru-ramaze-2008.08 lib/ramaze/snippets/proc/locals.rb
ramaze-2008.06 lib/ramaze/snippets/proc/locals.rb
ramaze-0.3.9 lib/ramaze/snippets/proc/locals.rb
ramaze-0.3.9.1 lib/ramaze/snippets/proc/locals.rb