Class: Regexer::Utils::Handlers::SingleEntityCheckerValueHandler::PatternObjectHandler

Inherits:
Base
  • Object
show all
Defined in:
lib/regexer/utils/handlers/single_entity_checker_value_handlers/pattern_object_handler.rb

Overview

A handler class to check if a pattern object is considered as single entity or not if this handler sees that the value is not a pattern object, it will then pass it to the next handler

Instance Method Summary collapse

Methods inherited from Base

#give_to_next_handler, #next_handler

Methods inherited from BaseHandler

#next_handler

Instance Method Details

#handle(value) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/regexer/utils/handlers/single_entity_checker_value_handlers/pattern_object_handler.rb', line 13

def handle(value)
  if value.instance_of?(::Regexer::Models::Pattern)
    value.single_entity?
  else
    give_to_next_handler(value)
  end
end