I come from C++ and JAVA, which with Scope there is either global or local.
I'm now learning ruby-on-rails and with ruby there is local, instance and global. I've never really heard of instance till now.
With or without rails, what is the understanding and usage of the instance variable?
Global = Variable across all objects share
Instance = Variable inside of the object
Local = Variable inside of the object
I think I'm getting instance and local kinda mixed together.
@ham
ham
These are two different variables right? Sometimes I get confused in Rails because they use stuff interchangably like @something and :something. Why is that?
Because I use the rails framework, all I understand the instance variable to be is something that is accessible by the view.
Can someone clarify these variables?