Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Created November 14, 2008 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevorturk/25025 to your computer and use it in GitHub Desktop.
Save trevorturk/25025 to your computer and use it in GitHub Desktop.
class Foo
attr_accessor :bar
def initialize(bar)
@bar = bar
end
def doit
puts bar
bar = "*** #{bar} ***"
puts bar
end
end
Foo.new('testing').doit
### OUTPUT ###
# testing
# *** ***
### WHY? ###
# Followup here: http://www.reddit.com/r/ruby/comments/7dewc/ruby_wtf_can_you_figure_out_why_this_is_happening/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment