From: Dossy Date: 2002-05-15T19:30:47+09:00 Subject: Re: cgi params api On 2002.05.15, Patrick May wrote: > > Mixin CGI::Param instead of subclassing String, don't walk over any > String methods. Then the object is exactly what it is: a String with > an Array mixed in. Please explain, using executable Ruby code, how you would mix-in CGI::Param instead of subclassing String. Are you suggesting that we mix-in CGI::Param into String, rather than making CGI::Param be a subclass of String? Like so: class String include CGI::Param end I definitely think this is NOT the better way of going about this. > Using a mixin makes it easier to extend this metaphor to file uploads Explain why the existing code isn't suitable for file uploads? If 'foo' is the named parameter, then cgi['foo'] would return you a CGI::Param whose value was the contents of the file. Ruby String can handle full 8-bit bytes and so they can completely handle binary data. cgi['foo'].to_s would return you a String that contained the uploaded file. I don't see what kind of "extending of the metaphor" is necessary to handle file uploads. -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)