Method: Miscellany::SortLang::Parser#valid?

Defined in:
lib/miscellany/sort_lang.rb

#valid?(sortstr) ⇒ Boolean

Returns:

  • (Boolean)


81
82
83
84
85
86
# File 'lib/miscellany/sort_lang.rb', line 81

def valid?(sortstr)
  parse(sortstr, ignore_errors: false)
  true
rescue SortParsingError
  false
end