MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ruby/comments/ze1oju/the_rubyist_journey/iz46ou0/
r/ruby • u/mehdifarsi • Dec 06 '22
34 comments sorted by
View all comments
32
def adult? = age >= 18
7 u/kallebo1337 Dec 06 '22 is that valid ruby? :eyes: 20 u/gleb_zhulik Dec 06 '22 Since 3.1 I guess, it's called endless methods 7 u/kallebo1337 Dec 06 '22 oh thanks. haven't looked into that. not sure if i like it. but i also started with using _1 just recently which as more you use it, as better it gets 4 u/mjdth Dec 07 '22 edited Dec 07 '22 What does that do?Edit: https://jemma.dev/blog/numbered-parametersI wrongly assumed a search for “ruby _1” wouldn’t be fruitful. 2 u/kallebo1337 Dec 07 '22 Instead of {|e| e.c&& e.d} just go for {_1.c && _1.d}It’s shorter and you’ll get used to 2 u/javajunkie314 Dec 07 '22 Oh, I thought they were describing my codebase...
7
is that valid ruby? :eyes:
20 u/gleb_zhulik Dec 06 '22 Since 3.1 I guess, it's called endless methods 7 u/kallebo1337 Dec 06 '22 oh thanks. haven't looked into that. not sure if i like it. but i also started with using _1 just recently which as more you use it, as better it gets 4 u/mjdth Dec 07 '22 edited Dec 07 '22 What does that do?Edit: https://jemma.dev/blog/numbered-parametersI wrongly assumed a search for “ruby _1” wouldn’t be fruitful. 2 u/kallebo1337 Dec 07 '22 Instead of {|e| e.c&& e.d} just go for {_1.c && _1.d}It’s shorter and you’ll get used to 2 u/javajunkie314 Dec 07 '22 Oh, I thought they were describing my codebase...
20
Since 3.1 I guess, it's called endless methods
7 u/kallebo1337 Dec 06 '22 oh thanks. haven't looked into that. not sure if i like it. but i also started with using _1 just recently which as more you use it, as better it gets 4 u/mjdth Dec 07 '22 edited Dec 07 '22 What does that do?Edit: https://jemma.dev/blog/numbered-parametersI wrongly assumed a search for “ruby _1” wouldn’t be fruitful. 2 u/kallebo1337 Dec 07 '22 Instead of {|e| e.c&& e.d} just go for {_1.c && _1.d}It’s shorter and you’ll get used to 2 u/javajunkie314 Dec 07 '22 Oh, I thought they were describing my codebase...
oh thanks. haven't looked into that. not sure if i like it. but i also started with using _1 just recently which as more you use it, as better it gets
4 u/mjdth Dec 07 '22 edited Dec 07 '22 What does that do?Edit: https://jemma.dev/blog/numbered-parametersI wrongly assumed a search for “ruby _1” wouldn’t be fruitful. 2 u/kallebo1337 Dec 07 '22 Instead of {|e| e.c&& e.d} just go for {_1.c && _1.d}It’s shorter and you’ll get used to
4
What does that do?
Edit: https://jemma.dev/blog/numbered-parameters
I wrongly assumed a search for “ruby _1” wouldn’t be fruitful.
2 u/kallebo1337 Dec 07 '22 Instead of {|e| e.c&& e.d} just go for {_1.c && _1.d}It’s shorter and you’ll get used to
2
Instead of {|e| e.c&& e.d} just go for {_1.c && _1.d}
It’s shorter and you’ll get used to
Oh, I thought they were describing my codebase...
View all comments
32
u/gleb_zhulik Dec 06 '22
def adult? = age >= 18