[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Module specific metric methods for Numeric

Benjamin Ter kuile

1/3/2009 11:22:00 AM

Something went wrong and the message was submitted before I was
finished, so here the rest:

The test script I wrote is:
class Numeric
def cm
self*2.54
end
end
puts "4.cm = #{4.cm}"
module Test
class Numeric

def cm
self*0.1
end
end
end

class Tc
include Test
def initialize
puts "4.cm => #{4.cm}"
end
end
t = Tc.new
puts "4.cm = #{4.cm}"
this results in:
4.cm = 10.16
4.cm => 10.16
4.cm = 10.16

Replacing class Numeric with class Object::Numeric will result in:
4.cm = 10.16
4.cm => 0.4
4.cm = 0.4

while the actual result that I aim for is:
4.cm = 10.16
4.cm => 0.4
4.cm = 10.16

Does anyone knows the answer to this one? Or an even better approach?

Many thanks,

Benjamin
--
Posted via http://www.ruby-....

16 Answers

\"jordy\

5/29/2013 3:17:00 AM

0

Hi Marc, I live in New Haven.

marcus

5/29/2013 1:59:00 PM

0

On May 28, 11:16 pm, Jordy Chase <icn...@gmail.com> wrote:
>    Hi Marc, I live in New Haven.

Home of the greatest tasting pizza in the entire world, "Frank Pepe's
Pizza".

My wife grew up in Branford.

Marc

http://marccaton...

marcus

5/29/2013 2:12:00 PM

0

On May 29, 9:58 am, marcus <marcus...@yahoo.com> wrote:
> On May 28, 11:16 pm, Jordy Chase <icn...@gmail.com> wrote:
>
> >    Hi Marc, I live in New Haven.
>
> Home of the greatest tasting pizza in the entire world, "Frank Pepe's
> Pizza".
>
> My wife grew up in Branford.
>
> Marc
>
> http://marccaton...

But just to keep this off-topic thread on topic, back in the day, I
got stoned in New Haven. ;-)

really real

5/29/2013 3:46:00 PM

0


> Home of the greatest tasting pizza in the entire world, "Frank Pepe's
> Pizza".
>

Spoken like someone who has never been to Oslo

\"jordy\

5/29/2013 5:13:00 PM

0

It's a small world, I grew up in Branford too... Personally, I think Sally's is the best Pizza in the world...

Just Walkin'

5/29/2013 7:15:00 PM

0

On May 29, 8:58 am, marcus <marcus...@yahoo.com> wrote:
> On May 28, 11:16 pm, Jordy Chase <icn...@gmail.com> wrote:
>
> >    Hi Marc, I live in New Haven.
>
> Home of the greatest tasting pizza in the entire world, "Frank Pepe's
> Pizza".
>
> My wife grew up in Branford.
>
> Marc
>
> http://marccaton...
>
Everyone knows Sally's is where it's at.

DianeE

5/30/2013 12:50:00 AM

0


"marcus" <marcus60s@yahoo.com> wrote in message
news:17e075af-cedd-4daf-b780-a333b7f7c614@t9g2000yqd.googlegroups.com...
On May 29, 9:58 am, marcus <marcus...@yahoo.com> wrote:
> On May 28, 11:16 pm, Jordy Chase <icn...@gmail.com> wrote:
>
> > Hi Marc, I live in New Haven.
>
> Home of the greatest tasting pizza in the entire world, "Frank Pepe's
> Pizza".
>
> My wife grew up in Branford.
>
> Marc
>
> http://marccaton...

But just to keep this off-topic thread on topic, back in the day, I
got stoned in New Haven. ;-)
-----------
I'll bring it even more on topic: I saw Bob Dylan and Joan Baez in concert
in New Haven in the spring of 1965.

DianeE


marcus

5/30/2013 1:01:00 AM

0

On May 29, 1:13 pm, Jordy Chase <icn...@gmail.com> wrote:
>    It's a small world, I grew up in Branford too... Personally, I think Sally's is the best Pizza in the world...

Nothing against Sally's, but I've always liked Pepe's. I hear that
there is a new Pepe's in my old hometown of Danbury...I can't imagine
that it is as good as the original...that old oven makes the
difference.

Remember "Libby's" the Italian bakery next door...I'm having a craving
for a cannoli right now.

My wife grew up in Short Beach, graduated from BHS in 1970.

Marc

marcus

5/30/2013 1:03:00 AM

0

On May 29, 8:50 pm, "DianeE" <TiredOfS...@SorryFolks.com> wrote:
> "marcus" <marcus...@yahoo.com> wrote in message
>
> news:17e075af-cedd-4daf-b780-a333b7f7c614@t9g2000yqd.googlegroups.com...
> On May 29, 9:58 am, marcus <marcus...@yahoo.com> wrote:
>
> > On May 28, 11:16 pm, Jordy Chase <icn...@gmail.com> wrote:
>
> > > Hi Marc, I live in New Haven.
>
> > Home of the greatest tasting pizza in the entire world, "Frank Pepe's
> > Pizza".
>
> > My wife grew up in Branford.
>
> > Marc
>
> >http://marccaton...
>
> But just to keep this off-topic thread on topic, back in the day, I
> got stoned in New Haven. ;-)
> -----------
> I'll bring it even more on topic:  I saw Bob Dylan and Joan Baez in concert
> in New Haven in the spring of 1965.
>
> DianeE

I saw Neil Young and Crazy Horse at the New Haven Coliseum in 1973.
His opening act? Linda Ronstadt.

Ever see a concert at the Yale Bowl? Saw Clapton there during his
Ocean Boulevard tour. Also saw Seals and Croft there too.

DianeE

5/30/2013 1:48:00 AM

0


"marcus" <marcus60s@yahoo.com> wrote in message
news:888e2fc1-7024-4fca-96c9-229ecc8bf308@t9g2000yqd.googlegroups.com...
On May 29, 8:50 pm, "DianeE" <TiredOfS...@SorryFolks.com> wrote:
> "marcus" <marcus...@yahoo.com> wrote in message
>
> But just to keep this off-topic thread on topic, back in the day, I
> got stoned in New Haven. ;-)
> -----------
> I'll bring it even more on topic: I saw Bob Dylan and Joan Baez in concert
> in New Haven in the spring of 1965.
>

I saw Neil Young and Crazy Horse at the New Haven Coliseum in 1973.
His opening act? Linda Ronstadt.

Ever see a concert at the Yale Bowl? Saw Clapton there during his
Ocean Boulevard tour. Also saw Seals and Croft there too.
------------
Nope, that was the only time in my life I've ever been to New Haven. And
needless to say, it was well worth the trip!

DianeE