tom-lord/regexp-examples

View on GitHub
lib/regexp-examples/parser_helpers/charset_negation_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
# A common helper used throughout various parser methods
module RegexpExamples
  module CharsetNegationHelper
    def negate_if(charset, is_negative)
      is_negative ? (CharSets::Any.dup - charset) : charset
    end
  end
end