Displaying 1 result from an estimated 1 matches for "validation_block".
2006 Apr 23
4
Penalties of using an eval on every request
...9;m
initializing them with some data.
survey.rb
q1 = Question.new "q1"
q1.quote "Welcome to a test of the new interviewing system."
q2 = Question.new "q2"
q2.quote "Do you like pie?"
q2.single 1 => "Yes", 2 => "No"
q2.validation_block = Proc.new { [1,2].include?
@interview.answers["2"] }
questionnaire.questions.concat [q1, q2]
-- Real-life questionnaires can be thousands of questions long!
How horrible would it be if I initialized the questionnaire.questions
object, on each request, by reading survey.rb from dis...