Module: L42::Interfaces::MapInp::RgxFilter

Extended by:
RgxFilter
Included in:
RgxFilter
Defined in:
lib/l42/interfaces/map_inp/rgx_filter.rb

Instance Method Summary collapse

Instance Method Details

#run(input, rgx_str, options) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/l42/interfaces/map_inp/rgx_filter.rb', line 8

def run(input, rgx_str, options)
  rgx = Regexp.compile(rgx_str)
  options[:sep] = "\u0000" if options.to_h[:"0"]
  [
    :stdout,
    input.filter_map(&_match_and_patterns(rgx, options))
  ]
end