我想知道为什么调用operator方法不需要点?或者更确切地说,为什么不能在没有点的情况下调用普通方法?
例
class Foo
def +(object)
puts "this will work"
end
def plus(object)
puts "this won't"
end
end
f = Foo.new
f + "anything" # "this will work"
f plus "anything" # NoMethodError: undefined method `plus' for main:Object