Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Stuff
- def initialize
- @blah = ""
- end
- def blah
- @blah
- end
- end
- s = Stuff.new
- s.blah << "things"
- s.blah #returns "things" - the instance variable was changed
- s.blah = "stuff" #returns error - if s.blah is really a reference to @blah, which is a String object, why can't I use the = method?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement