Class: Binding
Overview
Enhances the Binding class to easily extract local variables into a Hash.
Instance Method Summary collapse
-
#variables ⇒ Symbol to Object
Converts the local variables accessible from this binding into a Hash.
Instance Method Details
#variables ⇒ Symbol to Object
Converts the local variables accessible from this binding into a Hash. The keys of the hash are the variable names (as Symbols), and the values are the corresponding variable values.
17 18 19 20 21 22 23 |
# File 'lib/patch/let.rb', line 17 def variables Hash[ local_variables.map do |var| [var, local_variable_get(var)] end ] end |