Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
changing an instance variable
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jason Lillywhite, post: 4615480"] if I have these methods in a class: def initialize(x, y) @x, @y = x, y end def foo @z = @x + @y end def bar foo @z * 2 end What if I want to redefine @x inside method "foo" but only in there? is there a simple way to do this? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
changing an instance variable
Top