F
Florian Weber
hi!
im trying to define a set of rules with ruby, however i cant find a more
ruby-like way to do so..
instead of doing something like
my_set.add(NotNamedRule("orange").new)
my_set.add(HasPropertyRule("color").new)
my_set.add(OrRule(HasPropertyRule("size").new,
HasPropertyRule("weight").new))
(i know this is a horrible example. excuse the awful 'design'. its
justs to illustrate
what i not wanna have ; )
i wanna do something like
my_set.rules = !name("orange") && hasProperty("color") &&
(hasProperty("size") || hasProperty("weight"))
can anybody think of a nice way to do this?
thanks a lot for any feedback!
ciao!
florian
im trying to define a set of rules with ruby, however i cant find a more
ruby-like way to do so..
instead of doing something like
my_set.add(NotNamedRule("orange").new)
my_set.add(HasPropertyRule("color").new)
my_set.add(OrRule(HasPropertyRule("size").new,
HasPropertyRule("weight").new))
(i know this is a horrible example. excuse the awful 'design'. its
justs to illustrate
what i not wanna have ; )
i wanna do something like
my_set.rules = !name("orange") && hasProperty("color") &&
(hasProperty("size") || hasProperty("weight"))
can anybody think of a nice way to do this?
thanks a lot for any feedback!
ciao!
florian