Class: JSE::Stream::FilterChain
- Inherits:
-
Object
- Object
- JSE::Stream::FilterChain
- Defined in:
- lib/jse/stream.rb
Instance Method Summary collapse
- #eliminates?(line) ⇒ Boolean
-
#initialize(filters) ⇒ FilterChain
constructor
A new instance of FilterChain.
Constructor Details
#initialize(filters) ⇒ FilterChain
Returns a new instance of FilterChain.
83 84 85 |
# File 'lib/jse/stream.rb', line 83 def initialize(filters) @filters = filters end |
Instance Method Details
#eliminates?(line) ⇒ Boolean
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/jse/stream.rb', line 87 def eliminates?(line) begin json = JSON.parse(line) !@filters.all?{ |f| f.match?(json) } rescue JSON::ParserError $stderr.puts "Error parsing line:" $stderr.puts line true end end |