Class: Karafka::Web::Pro::Ui::Lib::Search::Matchers::RawKeyIncludes

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/pro/ui/lib/search/matchers/raw_key_includes.rb

Overview

Note:

It is case sensitive

Note:

Ignores encoding issues

Checks if the key contains requested phrase

Instance Method Summary collapse

Methods inherited from Base

active?, name

Instance Method Details

#call(message, phrase) ⇒ Boolean

Returns does message raw key contain the phrase.

Parameters:

  • message (Karafka::Messages::Message)
  • phrase (String)

Returns:

  • (Boolean)

    does message raw key contain the phrase



29
30
31
32
33
# File 'lib/karafka/web/pro/ui/lib/search/matchers/raw_key_includes.rb', line 29

def call(message, phrase)
  message.raw_key.to_s.include?(phrase)
rescue Encoding::CompatibilityError
  false
end