Topic: operators overloading question?
class Whatever
attr_accessor :number, :str
def initialize(number)
@number = number
@str = "Your number is : ( #{@number} )"
end
end
def >>a # I wanted to use this operator in order to put an object of class whatever
puts a.str
end
object = Whatever.new(10)
>>object # why doesn't it work?