Created
September 18, 2014 07:04
-
-
Save sharmaabhinav/f04d948b61836434df7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LocalVariableDemo | |
| def method | |
| 1 | |
| end | |
| def demo_method | |
| puts method # will call method with name "method" | |
| method = 1 if false # Here local variable come in picture | |
| puts method # nil , local variable | |
| end | |
| end | |
| obj = LocalVariableDemo.new | |
| obj.demo_method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment