I am still learning ruby. My question is, often we see things like this:
@miles = miles
Here, we’re defining a custom method set_miles , then passing it an
argument (what’s the reason of doing so?), then we’re setting the
instance variable @miles to a local variable miles, why’s that for? I
know I can use attr_accessor but things like this occurs in various
place. What’s the point of doing this?
I know I sound funny but i can’t understand. Any help would be much much