Skip to content

Instantly share code, notes, and snippets.

@sixtyfive
Created January 21, 2015 21:34
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 sixtyfive/efafe7b9118af8150198 to your computer and use it in GitHub Desktop.
Save sixtyfive/efafe7b9118af8150198 to your computer and use it in GitHub Desktop.
Thing with strings and Ruby
mystring = "something"
puts mystring
=> "something" # okay, so far so good
foobar = "test"
mystring = '#{foobar}' # note the single quotation marks!
puts mystring
=> "#{foobar}" # not what i want
puts eval mystring
=> nil # not what i want, either
=> "test" # <= this is what i wish to get back somehow...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment