Class: Axlsx::RestrictionValidator
- Inherits:
-
Object
- Object
- Axlsx::RestrictionValidator
- Defined in:
- lib/axlsx/util/validators.rb
Overview
Validate a value against a specific list of allowed values.
Class Method Summary (collapse)
-
+ (Boolean) validate(name, choices, v)
Perform validation.
Class Method Details
+ (Boolean) validate(name, choices, v)
Perform validation
10 11 12 13 |
# File 'lib/axlsx/util/validators.rb', line 10 def self.validate(name, choices, v) raise ArgumentError, (ERR_RESTRICTION % [v.to_s, name, choices.inspect]) unless choices.include?(v) true end |