From: Mario Camou Date: 2009-11-16T10:16:38+09:00 Subject: Re: Newbie question: Defining a numeric type Have a look at Forwardable On Monday, November 16, 2009, Seebs wrote: > I have a type which has a bit of internal magic, but fundamentally, I want > it to behave for most purposes like the value it yields from to_i/to_int. > > Basically, is there a way to avoid having to write +, -, etcetera, when > in each case it'd be: >        def (other) >          self.to_i other >        end > > I think I'm thinking something like the Comparable mixin; sort of a > "I have a to_i, make me a number" module. > > -s > -- > Copyright 2009, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net > http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures > http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated! > > -- -Mario. -- I want to change the world but they won't give me the source code.