Ruby Language instance_eval

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


  • object.instance_eval 'code'
  • object.instance_eval 'code', 'filename'
  • object.instance_eval 'code', 'filename', 'line number'
  • object.instance_eval { code }
  • object.instance_eval { |receiver| code }


stringContains the Ruby source code to be evaluated.
filenameFile name to use for error reporting.
linenoLine number to use for error reporting.
blockThe block of code to be evaluated.
objThe receiver is passed to the block as its only argument.

Got any Ruby Language Question?