From: Nikolai Weibull Date: 2005-08-26T01:37:13+09:00 Subject: Re: idea: klass.from_s(str) Eric Mahurin wrote: > The ugliness I think is when you are dealing with an arbitrary > class. You typically come up with an abbreviation for the > class and make a String#to_ method convert a string to > an object of that class. You could have collisions with > another class using the same name. Well, considering that there are only two methods in String by default: irb(main):003:0> String.methods.grep(/^to_/).sort => ["to_a", "to_s"], I really don't see the problem. How many classes need to be able to be created from a String anyway?, nikolai P.S. OK, the following is kind of ugly when you think about it: irb(main):004:0> require 'yaml' => true irb(main):005:0> String.methods.grep(/^to_/).sort => ["to_a", "to_s", "to_yaml", "to_yaml_properties", "to_yaml_type"] D.S. -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}