Class: Pipe::Filter::JSONContains
- Inherits:
-
Object
- Object
- Pipe::Filter::JSONContains
- Defined in:
- lib/pipe/filter/json_contains.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ JSONContains
constructor
A new instance of JSONContains.
- #match?(object) ⇒ Boolean
Constructor Details
#initialize(options) ⇒ JSONContains
Returns a new instance of JSONContains.
2 3 4 |
# File 'lib/pipe/filter/json_contains.rb', line 2 def initialize() @options = end |
Instance Method Details
#match?(object) ⇒ Boolean
6 7 8 9 |
# File 'lib/pipe/filter/json_contains.rb', line 6 def match?(object) match = object[@options[:attribute]] =~ /#{@options[:contains]}/ match and match >= 0 end |