Open1
Tech Tips
In Ruby, there is an interesting feature called message passing
.
irb(main):009:0> 1 + 2
=> 3
irb(main):010:0> 1.+(2)
=> 3
irb(main):011:0> 1.send "+",2
=> 3
In a second code, you put a 2
as 引数 of the + method. 1
is an object.
send
is a method to send some information.