search for: speed_limit

Displaying 1 result from an estimated 1 matches for "speed_limit".

2006 Nov 04
0
traits-0.10.0
...end but the really cool thing is that all of these blocks are both passed the value in question but also evaluate with ''self'' set appropriately. eg class Car positive_int = lambda{|n| Fixnum === n and n > 0} legal = proc{|s| s < speed_limit} trait ''speed_limit'', ''validate'' => positive_int, ''default'' => 42 trait ''speed'', ''validate'' => legal end c = Car::new c.speed = 115 works as...