Class: Hermod::Validators::AllowedValues
- Defined in:
- lib/hermod/validators/allowed_values.rb
Overview
Checks the given value is in a predefined list of allowed values
Instance Attribute Summary collapse
-
#allowed_values ⇒ Object
readonly
Returns the value of attribute allowed_values.
Instance Method Summary collapse
-
#initialize(allowed_values) ⇒ AllowedValues
constructor
Sets up the validator with the list of allowed values.
Methods inherited from Base
Constructor Details
#initialize(allowed_values) ⇒ AllowedValues
Sets up the validator with the list of allowed values
10 11 12 |
# File 'lib/hermod/validators/allowed_values.rb', line 10 def initialize(allowed_values) @allowed_values = allowed_values end |
Instance Attribute Details
#allowed_values ⇒ Object (readonly)
Returns the value of attribute allowed_values.
7 8 9 |
# File 'lib/hermod/validators/allowed_values.rb', line 7 def allowed_values @allowed_values end |