How does Ruby’s .() operator work?
The dot-parentheses notation is a shorthand way for passing arguments to the implicit call method on a Ruby object: foo = lambda {|bar| puts bar} foo.call(‘baz’) #=> baz foo.(‘baz’) foo.call(‘baz’) === foo.(‘baz’) #=> true Also note that the following notations are also valid (and equivalent) invocations of the call method: foo[‘baz’] #=> baz foo::(‘baz’) #=> … Read more