Ruby LanguageDynamic Evaluation

Download Ruby Language for free

Syntax

  • eval "source"
  • eval "source", binding
  • eval "source", proc
  • binding.eval "source" # equal to eval "source", binding

Parameters

ParameterDetails
"source"Any Ruby source code
bindingAn instance of Binding class
procAn instance of Proc class

Related Examples

Dynamically Creating Methods from Strings