Class: CARPS::Sheet::Choice
Overview
Accept one of a Set of possible values
Instance Method Summary collapse
-
#initialize(optional, choices) ⇒ Choice
constructor
The second argument is the Set of possible values.
-
#valid(val) ⇒ Object
Only true for a member of the Set of possible values.
Methods inherited from Type
Constructor Details
#initialize(optional, choices) ⇒ Choice
The second argument is the Set of possible values
112 113 114 115 |
# File 'lib/carps/mod/sheet/type.rb', line 112 def initialize optional, choices super optional @choices = choices end |
Instance Method Details
#valid(val) ⇒ Object
Only true for a member of the Set of possible values
118 119 120 |
# File 'lib/carps/mod/sheet/type.rb', line 118 def valid val @choices.member? val.downcase end |