Created
May 7, 2018 14:43
-
-
Save shunwen/be6ae7019a71593c070fa57ab703992b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo | |
some_function(true, { :before => {a: 1}, | |
:after => {b: 2} }) | |
call_block { do_something } | |
end | |
def bar | |
case @var | |
when 1 | |
print [1..42] | |
else | |
print [1...42] | |
end | |
end | |
A = [1, [2, [3] ] ] | |
private | |
def foobar(p1: nil, | |
p2: true, | |
p3: nil) | |
a = p1 == p2 | |
p2 =~ /something/ | |
p3 = ( (p1) + p2 ) | |
end | |
foobar(p1: "", | |
p2: false, | |
p3: 1) | |
def foo | |
'ba' + | |
'r' | |
end | |
what_is_foo = case foo | |
when 'baz' | |
'foo is baz' | |
when 'bar' | |
'foo is bar' | |
else | |
'foo is strange' | |
end | |
return if foo? | |
class Example | |
def public1 | |
end | |
private | |
def private1 | |
end | |
protected | |
def protected1 | |
end | |
public | |
def public2 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment