From: Robert Klemme Date: 2008-01-09T21:10:44+09:00 Subject: Re: struct equivalent with rails-y keyword args hash? 2008/1/9, Giles Bowkett : > I have some code which uses Structs. I'd rather use keyword args. I'm > generating data objects to store MIDI note data, and it's kind of > hideously unreadable: > > Note.new(2, 43, 0.25, 127, now += interval) > > This would be much nicer: > > Note.new(:channel => 2, > :note => 43, > :duration => 0.25, > :velocity => 127, > :time => now += interval) Then just use that form. Kind regards robert -- use.inject do |as, often| as.you_can - without end