Yes, that would work nicely. Thank you! On Apr 11, 2007, at 9:42 PM, Nick Zadrozny wrote:
Well, you're working with an Enumerable object at that point. I think you'd do just fine with Enumerable#find http://www.ruby-doc.org/core/classes/Enumerable.html#M003154 @specific_blurb = @blurbs.find { |b| b.name == "Something specific" }You might mix a helper method into Enumerable that abstracts some of that out.module Enumerable def find_by_name(str) find { |obj| obj.name == str } end endThen all you'd need to do is @blurbs.find_by_name("Something specific")Good question! I hope that helps :-) -- Nick Zadrozny • http://missionsbridge.org/people/nick _______________________________________________ Sdruby mailing list [EMAIL PROTECTED] http://lists.sdruby.com/mailman/listinfo/sdruby
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Sdruby mailing list [EMAIL PROTECTED] http://lists.sdruby.com/mailman/listinfo/sdruby
