Module: MagicCompare::String

Defined in:
lib/magic_compare/string.rb

Instance Method Summary collapse

Instance Method Details

#magic_compare(string_to_compare) ⇒ Object



5
6
7
8
# File 'lib/magic_compare/string.rb', line 5

def magic_compare(string_to_compare)
  return false if string_to_compare.nil?
  I18n.transliterate(self).downcase.strip == I18n.transliterate(string_to_compare).downcase.strip
end

#magic_include?(string_to_check) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/magic_compare/string.rb', line 10

def magic_include?(string_to_check)
  return false if string_to_check.nil?
  I18n.transliterate(self).downcase.strip.include? I18n.transliterate(string_to_check).downcase.strip
end