Y
Hacker News
new
|
ask
|
show
|
jobs
by
slmgc
3002 days ago
Yep, it's way easier to implement in some other languages. Btw, is it callable as well? Can you do Whatever.new().foo.bar().baz with it?
2 comments
baddox
3002 days ago
Nope. Ruby doesn’t support the function call paren syntax for anything other than methods. You could do stuff like Whatever.new().foo.().bar[] though.
link
djur
3002 days ago
foo, bar, and baz are all methods here, so you can use parens.
link
vemv
3002 days ago
`.foo.bar` are method calls (parenses are optional in Ruby)
link