Class: JSE::CaseInsensitiveFilter
- Inherits:
-
Object
- Object
- JSE::CaseInsensitiveFilter
- Defined in:
- lib/jse/case_insensitive_filter.rb
Instance Method Summary collapse
-
#initialize(field, text) ⇒ CaseInsensitiveFilter
constructor
A new instance of CaseInsensitiveFilter.
- #match?(json) ⇒ Boolean
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
7 8 9 |
# File 'lib/jse/case_insensitive_filter.rb', line 7 def match?(json) json[@field] && json[@field].upcase == @text.upcase end |