Class: Cannonbol::NotAny

Inherits:
ParameterizedPattern show all
Defined in:
lib/cannonbol/cannonbol.rb

Instance Method Summary collapse

Methods inherited from ParameterizedPattern

#initialize, parameter

Methods included from Operators

#&, #_match?, #capture!, #capture?, included, #insensitive, #matches?, #|

Constructor Details

This class inherits a constructor from Cannonbol::ParameterizedPattern

Instance Method Details

#__match?(needle, thread_state = nil) ⇒ Boolean

Returns:

  • (Boolean)


422
423
424
425
426
427
428
# File 'lib/cannonbol/cannonbol.rb', line 422

def __match?(needle, thread_state = nil)
  if thread_state
    needle.pull(thread_state)
  elsif !(chars(needle).include? needle.remaining_string[0..0])
    [needle.push(1)]
  end
end