Skip to content

Instantly share code, notes, and snippets.

@lenary
Created April 27, 2009 21:00
Show Gist options
  • Save lenary/102731 to your computer and use it in GitHub Desktop.
Save lenary/102731 to your computer and use it in GitHub Desktop.
# Arrays
['a', 'b', 'c'] # Without interpolation
["a", "b", "c"] # With interpolation
%w(a b c) # Without interpolation
%W(a b c) # With interpolation
# Strings
'a' # Without interpolation
"a" # With interpolation and backslashes
`a` # Command Interpretation with interpolation and backslashes
%q(a) # Without interpolation
%Q(a) # With interpolation and backslashes
%(a) # With interpolation and backslashes
%x(a) # Command Interpretation with interpolation and backslashes
# Symbols
:a # without interpolation
:'a' # without interpolation
:"a" # with interpolation
%s(a) # with interpolation
# Regexes
/a/ # normal use
%r(a) # can replace () with any character or {} pair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment