-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathmethod_arguments.rb
More file actions
72 lines (58 loc) · 2.06 KB
/
method_arguments.rb
File metadata and controls
72 lines (58 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def method; hello, world = [1,2] end # test comment
def method_with_parentheses(a, b, c = [foo,bar,baz]); hello, world = [1,2] end # test comment
def method_without_parentheses a, b, c = [foo,bar,baz]; hello, world = [1,2] end # test comment
def method # test comment
hello, world = [1,2]
end
def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment
hello, world = [1,2]
end
def method_without_parentheses a, b, c = [foo,bar,baz] # test comment
hello, world = [1,2]
end
def method_with_parentheses(a, b = "hello", c = ["foo", "bar"], d = (2 + 2) * 2, e = {}) # test comment
hello, world = [1,2]
do_something1
do_something2
end
def method_without_parentheses a, b = "hello", c = ["foo", "bar"], d = (2 + 2) * 2, e = "" # test comment
hello, world = [1,2]
do_something1
do_something2
end
def method_with_parentheses(a,
b = hello, # test comment
c = ["foo", bar, :baz],
d = (2 + 2) * 2,
e = {})
hello, world = [1,2]
do_something1
do_something2
end
def method_without_parentheses a,
b = "hello" , # test comment
c = ["foo", bar, :baz],
d = (2 + 2) * 2,
e = proc { |e| e + e }
hello, world = [1,2]
do_something1
do_something2
end
def method_without_parentheses a,
b: hello , # test comment
c: ["foo", bar, :baz],
d: (2 + 2) * 2,
e: proc { |e| e + e }
hello, world = [1,2]
do_something1
do_something2
end
# double splat, splat, and & opearator
def method_with_parentheses(*a, **b, &c); hello, world = [1,2] end # test comment
def method_without_parentheses *a, **b, &c; hello, world = [1,2] end # test comment
def method_with_parentheses(*a, **b, &c) # test comment
hello, world = [1,2]
end
def method_without_parentheses *a, **b, &c # test comment
hello, world = [1,2]
end