Sha256: c28b7360a17fb8f8ba77b3cd255898ba9afda9a26ffd6e8e9fc5b682382d04f8
Contents?: true
Size: 934 Bytes
Versions: 18
Compression:
Stored size: 934 Bytes
Contents
module Ecoportal module API module Common module Content module ModelHelpers private # Offers multiple ways to compare two strings def same_string?(value1, value2, exact: false) case when value1.is_a?(String) && value2.is_a?(String) if exact value1 == value2 else value1.to_s.strip.downcase == value2.to_s.strip.downcase end when value1.is_a?(Regexp) && value2.is_a?(String) value2 =~ value1 when value1.is_a?(String) && value2.is_a?(Regexp) value1 =~ value2 else value1 == value2 end end def hash_except(hash, *keys) keys.each {|key| hash.delete(key)} hash end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems