From: Brian Candler Date: 2011-01-27T04:53:16+09:00 Subject: Re: to use AR or not? (table defined in code) Jason Cameron wrote in post #977627: > Well it looks like the largest table has 6-7 columns and around 70-80 > rows. OK, that's a pretty small dataset. > I'll look into OpenStruct and redis but I'm curious about your linear > scan options. > >> objs.find { |o| ... condition ... } > > Would I have to create the find functionality myself? Nope; if objs is an Array containing your rows, then Array already mixes in Enumerable which includes a find method (also find_all/select, which gives all matching rows, not just the first one) > I'm assuming I'm > creating a class to hold the object. You can certainly do that. As you already found, Struct gives you an easy way to create a class with accessors. OpenStruct is a more dynamic object, basically a wrapper around a Hash. -- Posted via http://www.ruby-forum.com/.