Class: SerializableProc::Binding
- Inherits:
-
Object
- Object
- SerializableProc::Binding
- Includes:
- Isolatable, Marshalable
- Defined in:
- lib/serializable_proc/binding.rb
Constant Summary
Constants included from Isolatable
Isolatable::BLOCK_SCOPES, Isolatable::ISOLATION_VAR, Isolatable::MAPPERS
Instance Method Summary collapse
- #eval!(binding = nil) ⇒ Object
-
#initialize(binding, sexp) ⇒ Binding
constructor
A new instance of Binding.
Methods included from Marshalable
Constructor Details
#initialize(binding, sexp) ⇒ Binding
Returns a new instance of Binding.
11 12 13 14 15 |
# File 'lib/serializable_proc/binding.rb', line 11 def initialize(binding, sexp) @vars = isolatable_vars(sexp).inject({}) do |memo, (o_var, n_var)| memo.merge(n_var => bounded_val(o_var, binding)) end end |
Instance Method Details
#eval!(binding = nil) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/serializable_proc/binding.rb', line 17 def eval!(binding = nil) unless binding @binding ||= ( eval(declare_vars, binding = Kernel.binding) binding ) else eval(declare_vars, binding) binding end end |