Love U Ruby wrote in post #1120864:
> I am confused on the second call :-
>
> class Foo
> def <<(param)
> "hi"
> end
> end
> foo = Foo.new
> foo.<<(1) # => "hi"
>
> foo << 1 # => "hi" # I didn't use `.` method,then how method `<<` has
> been called?
I would image that it works the same as it does for the +, -, *, and /
methods.
Example:
$ irb
irb(main):001:0> 5 + 7
=> 12
irb(main):002:0> 5.+(7)
=> 12