Class: RSpecTracer::Filter
- Inherits:
-
Object
- Object
- RSpecTracer::Filter
show all
- Defined in:
- lib/rspec_tracer/filter.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(filter) ⇒ Filter
Returns a new instance of Filter.
7
8
9
|
# File 'lib/rspec_tracer/filter.rb', line 7
def initialize(filter)
@filter = filter
end
|
Instance Attribute Details
#filter ⇒ Object
Returns the value of attribute filter.
5
6
7
|
# File 'lib/rspec_tracer/filter.rb', line 5
def filter
@filter
end
|
Class Method Details
.filter_class(filter) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/rspec_tracer/filter.rb', line 21
def self.filter_class(filter)
case filter
when String
StringFilter
when Regexp
RegexFilter
when Proc
BlockFilter
when Array
ArrayFilter
else
raise ArgumentError, 'Unknow filter'
end
end
|
.register(filter) ⇒ Object
15
16
17
18
19
|
# File 'lib/rspec_tracer/filter.rb', line 15
def self.register(filter)
return filter if filter.is_a?(Filter)
filter_class(filter).new(filter)
end
|
Instance Method Details
#match?(_source_file) ⇒ Boolean
11
12
13
|
# File 'lib/rspec_tracer/filter.rb', line 11
def match?(_source_file)
raise "#{self.class.name}#match? is not intended for direct use"
end
|