Class: Renamr::ASCIIValidatorAction
- Defined in:
- lib/renamr/ascii_validator.rb
Overview
Checks if the resulted string has only ASCII symbols.
Instance Method Summary collapse
Methods inherited from Action
Instance Method Details
#do(src) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/renamr/ascii_validator.rb', line 11 def do(src) ascii = src.chars.select(&:ascii_only?).join raise "String #{src} has non-ASCII symbols." if src != ascii src end |