Skip to content

Instantly share code, notes, and snippets.

@dbackeus
Created August 16, 2011 15:46
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 dbackeus/1149392 to your computer and use it in GitHub Desktop.
Save dbackeus/1149392 to your computer and use it in GitHub Desktop.
linebreaks etc
# Statement are seperated by line breaks
def my_method
"hello"
end
# You can put several statements on one line if...
def my_method; "hello"; end
# After an operator...
1 +
1
# => 2
"20".
to_i
# => 20
# Linebreaks in strings
string = "I have
linebreaks!"
@kotp
Copy link

kotp commented Sep 28, 2012

string = "I don't have\
linebreaks!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment