On 2002.08.23, Eugene Scripnik <Eugene.Scripnik / itgrp.net> wrote:
>   I have a methods that converts all DB rows into structs using Struct
>   class.

Can I ask what the advantage of storing it as a Struct is?

In all my Ruby/DBI code, I do something like this:

    def select(sql)
        sth = $dbh.prepare(sql)
        sth.execute
        results = []
        sth.fetch_hash { |row| results << row.dup }
        sth.finish
        results
    end

Is there any advantage to having it be a Struct instead of an
Array of Hash'es?

-- 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)