How can I disable a variable in Ruby / ROR?

Possible duplicate:
Define Uncertainty in Ruby

In php, I could do the following:

$myVariable = 'foo'; echo $myVariable; unset( $myVariable ); 

How can I do basically the same thing on ruby ​​ground?

+4
source share
1 answer

You can set it to nil. Example: your_variable = "your name" Now that you want to "cancel" it, you can do your_variable = nil

-3
source

Source: https://habr.com/ru/post/1438494/


All Articles