instance eval
suggest changeVersions
[{“Name”:“2.2”,“GroupName”:null},{“Name”:“2.3”,“GroupName”:null}]
Syntax
- 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 }
Parameters
Parameter | Details |
––––– | ——————————————————— |string
| Contains the Ruby source code to be evaluated. |filename
| File name to use for error reporting. |lineno
| Line number to use for error reporting. |block
| The block of code to be evaluated. |obj
| The receiver is passed to the block as its only argument. |
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents