Class: Rosette::Core::Validators::EncodingValidator
- Defined in:
- lib/rosette/core/validators/encoding_validator.rb
Overview
Validates an encoding.
Instance Attribute Summary
Attributes inherited from Validator
Instance Method Summary collapse
-
#valid?(encoding, repo_name, configuration) ⇒ Boolean
Returns true if the encoding is valid, false otherwise.
Methods inherited from Validator
Constructor Details
This class inherits a constructor from Rosette::Core::Validators::Validator
Instance Method Details
#valid?(encoding, repo_name, configuration) ⇒ Boolean
Returns true if the encoding is valid, false otherwise.
21 22 23 24 25 26 27 |
# File 'lib/rosette/core/validators/encoding_validator.rb', line 21 def valid?(encoding, repo_name, configuration) Encoding.find(encoding) true rescue ArgumentError << "Encoding '#{encoding}' was not recognized." false end |