Class: JSE::CaseInsensitiveFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/jse/case_insensitive_filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(field, text) ⇒ CaseInsensitiveFilter

Returns a new instance of CaseInsensitiveFilter.



3
4
5
# File 'lib/jse/case_insensitive_filter.rb', line 3

def initialize(field, text)
  @field, @text = field, text
end

Instance Method Details

#match?(json) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/jse/case_insensitive_filter.rb', line 7

def match?(json)
  json[@field] && json[@field].upcase == @text.upcase
end