mgamer
mgamer

Reputation: 14050

Overload ! operator in Ruby

Is it possible to overload ! operator in Ruby language?

Upvotes: 1

Views: 345

Answers (2)

Mark Byers
Mark Byers

Reputation: 838216

Yes, in Ruby 1.9 ! is a method and can be overridden.

Source

Upvotes: 1

Sankar Ganesh PMP
Sankar Ganesh PMP

Reputation: 12027

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

Upvotes: 3

Related Questions