Class: RSpecTracer::ArrayFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/rspec_tracer/filter.rb

Instance Attribute Summary

Attributes inherited from Filter

#filter

Instance Method Summary collapse

Methods inherited from Filter

filter_class, register

Constructor Details

#initialize(filters) ⇒ ArrayFilter

Returns a new instance of ArrayFilter.



38
39
40
41
42
43
44
# File 'lib/rspec_tracer/filter.rb', line 38

def initialize(filters)
  filter_list = filters.each_with_object([]) do |filter, list|
    list << Filter.register(filter)
  end

  super(filter_list)
end

Instance Method Details

#match?(source_file) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/rspec_tracer/filter.rb', line 46

def match?(source_file)
  @filter.any? { |filter| filter.match?(source_file) }
end