From: James Edward Gray II Date: 2005-06-14T02:04:05+09:00 Subject: Re: [Highline] Custom validation On Jun 13, 2005, at 8:30 AM, Gavin Kistner wrote: > On Jun 13, 2005, at 7:24 AM, Gavin Kistner wrote: > >> Is it possible to pass a custom post-validation block to to a >> Highline::Question, which will use the return value of that block >> to determine if the question should be asked again? (If not, >> consider this a feature request.) >> > > The answer is "RTFM past the first sentence describing the > Question#validate property, onto the second sentence." > > Sorry for the noise :p Looks like you found your answer, but for the sake of completeness HighLine validation can be done with a Proc: ask("Piece to move: ") { |q| q.validate = lambda { |move| is_legal? move } } James Edward Gray II