From: dblack@... Date: 2006-06-24T21:03:03+09:00 Subject: Re: prop = x => y Hi -- On Sat, 24 Jun 2006, Roger Johansson wrote: > also , is it wrong to use the x => y construct in other context than > describing hashtables? I don't know of any meaning for => other than hash separator. > in my case my idea was to associate symbols with values in a sort of > .net attribute/annotation way > > " > meta.some_prop= :parent_of => [:sometype,:someprop] > attr_accessor :some_prop > " > > it works just fine for everything except for set properties. (whatever > you might call them in ruby) > > " > meta.my_meth :foo => :bar > def my_meth() > end > " > > works just fine.. > > (the "meta" is an extended method on Class which returns an attribute > object which in turn handles method_missing and then stores the > class,methodid and data in a static lookup) Be advised: nothing is static in Ruby :-) David -- David A. Black (dblack@wobblini.net) Ruby Power and Light, LLC (http://www.rubypowerandlight.com) See what the readers are saying about "Ruby for Rails"! http://www.rubypowerandlight.com/quotes