Class: Regexer::Utils::Handlers::AnyCharacterInInputValueHandlers::RegexShorthandPatternHandler

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

Overview

A handler class to check if input value is a Regexer::Models::Pattern object tagged as regex shorthand character this returns the raw_pattern of that object

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



14
15
16
17
18
19
20
# File 'lib/regexer/utils/handlers/any_character_in_input_value_handlers/regex_shorthand_pattern_handler.rb', line 14

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