-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix arguments in method defifinition with parentheses. Add support fo…
…r multiline arguments in method definition without parentheses.
- Loading branch information
1 parent
02613b0
commit 2c906ca
Showing
2 changed files
with
141 additions
and
111 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
def method | ||
hello, world = [1,2] | ||
end | ||
|
||
def method_with_parentheses(a, b, c = [foo,bar,baz]) | ||
hello, world = [1,2] | ||
end | ||
|
||
def method_without_parentheses a, b, c = [foo,bar,baz] | ||
hello, world = [1,2] | ||
end | ||
|
||
|
||
def method_with_parentheses(a, b = "hello", c = ["foo", "bar"], d = (2 + 2) * 2, e = {}) | ||
hello, world = [1,2] | ||
do_something1 | ||
do_something2 | ||
end | ||
|
||
def method_without_parentheses a, b = "hello", c = ["foo", "bar"], d = (2 + 2) * 2, e = "" | ||
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 |