From: "Brian Schröder" Date: 2005-05-25T06:06:44+09:00 Subject: Re: new article On 24/05/05, pat eyler wrote: > Sorry for posting about my own article, but I'm interested in feedback, > recommendations for future topics, etc. IBM has just published an > article I wrote about doing test first development with Ruby: > > http://www.ibm.com/developerworks/edu/os-dw-os-ruby1-i.html > > (sorry, you need to sign in (free account) to read it). > > I've got an opportunity to do some more writing for them (how much > more depends on how well received/popular the articles are), and I'd > love to get some feedback from the community about what kinds of > Ruby things I should be sending their way. > > -- > thanks, > -pate > ------------------------- > We are often unable to tell people what they need to know, because > they want to know something else, and would therefore only > misunderstand what we said > - the Raven (George MacDonald, Lilith) > > Just started with your article, and I wonder why you build a constructor that tests for object classes, why not simply call .to_s on the argument? class T attr_reader :key def initialize(key) @key = key.to_s end en [T.new(1).key, T.new("1").key, T.new([1]).key] => ["1", "1", "1"] best regards, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/