From: Morton Goldberg Date: 2007-10-01T00:12:45+09:00 Subject: Re: [QUIZ] Probable Iterations (#141) On Sep 30, 2007, at 9:32 AM, Jes�s Gabriel y Gal�n wrote: > $compare_types = {"at_least" => :>=, "exactly" => :==, > "no_more_than" => :<=, > "more_than" => :>, "less_than" => :<} > My question about main is the following: if you check my code, I have > a variable ($compare_types) I need to use both in the validate block > for an option and in the run method. Is there a better way to achieve > this than a global variable? I suggest making it a constant. COMPARE_TYPES = { "at_least" => :>=, "exactly" => :==, "no_more_than" => :<=, "more_than" => :>, "less_than" => :< } Regards, Morton