From: Eric Hodel Date: 2004-05-25T11:31:14-07:00 Subject: Re: defining condititions --byLs0wutDcxFdwtm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Florian Weber (csshsh@structbench.com) wrote: > hi! >=20 > im trying to define a set of rules with ruby, however i cant find a more > ruby-like way to do so.. >=20 > instead of doing something like >=20 > my_set.add(NotNamedRule("orange").new) > my_set.add(HasPropertyRule("color").new) > my_set.add(OrRule(HasPropertyRule("size").new,=20 > HasPropertyRule("weight").new)) >=20 > (i know this is a horrible example. excuse the awful 'design'. its=20 > justs to illustrate > what i not wanna have ; ) >=20 > i wanna do something like >=20 > my_set.rules =3D !name("orange") && hasProperty("color") &&=20 > (hasProperty("size") || hasProperty("weight")) >=20 > can anybody think of a nice way to do this? Have a look at Criteria: http://mephle.org/Criteria/ --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --byLs0wutDcxFdwtm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFAs5DyMypVHHlsnwQRAstCAKDNPrVkk+8ftIFK+hu+2MwLmd/cQQCfbQns aw39Lg3HABCHaOZhZO2LbM4= =Kigh -----END PGP SIGNATURE----- --byLs0wutDcxFdwtm--