From: Eliezer Croitoru Date: 2012-09-21T12:50:14+09:00 Subject: How would you allow variable from specific list of Fixnum? I have: def initialize(type= nil,location=nil,mode=17) and the mode can be one of these: 1,4,17,20 but.. I want that If anyone tries to use other number then these he will get exception error. how would you implement it? using raise? I was thinking about: modes = [1, 4, 17, 20] raise SyntaxError.new("Modes Allowed: #{modes}") if !modes.index(mode) Thanks, Eliezer