Class: Regexer::Utils::Handlers::SingleEntityCheckerValueHandler::StringHandler

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

Overview

A handler class to check if a string value is considered as single entity or not if this handler sees that the value is not a string, 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/string_handler.rb', line 13

def handle(value)
  if value.instance_of?(String)
    value.length == 1
  else
    give_to_next_handler(value)
  end
end