Overload ! operator in Ruby
Is it possible to overload ! operator in Rub开发者_运维问答y language?
yes, you can overload this ! in Ruby 1.9, see here http://phrogz.net/programmingruby/language.html#table_18.4 , in this url they had given what are the operators, which are overloaded in Ruby
Yes, in Ruby 1.9 !
is a method and can be overridden.
Source
精彩评论