Class: SimpleCov::Filter

### Home Classes Methods

### In Files

- lib/simplecov/filter.rb

### Parent

Object

### Methods

- ::new
- #matches?
- #passes?

### Class/Module Index

Quicksearch

- SimpleCov
- SimpleCov::ArrayFilter
- SimpleCov::ArrayMergeHelper
- SimpleCov::BlockFilter
- SimpleCov::CommandGuesser
- SimpleCov::Configuration
- SimpleCov::ExitCodes
- SimpleCov::FileList
- SimpleCov::Filter
- SimpleCov::Formatter
- SimpleCov::Formatter::MultiFormatter
- SimpleCov::Formatter::SimpleFormatter
- SimpleCov::HashMergeHelper
- SimpleCov::LastRun
- SimpleCov::Profiles
- SimpleCov::Railtie
- SimpleCov::Result
- SimpleCov::ResultMerger
- SimpleCov::SourceFile
- SimpleCov::SourceFile::Line
- SimpleCov::StringFilter
- SimpleCov::VERSION
- Coverage

No matching classes.

# SimpleCov::Filter

Base filter class. Inherit from this to create custom filters, and overwrite the passes?(source_file) instance method

# A sample class that rejects all source files. class StupidFilter < SimpleCov::Filter

    def passes?(source_file)
      false
    end

end

### Attributes

filter_argument[R]

### Public Class Methods

new(filter_argument) click to toggle source

    # File lib/simplecov/filter.rb, line 15
    def initialize(filter_argument)
      @filter_argument = filter_argument
    end

### Public Instance Methods

matches?(_) click to toggle source

    # File lib/simplecov/filter.rb, line 19
    def matches?(_)
      fail "The base filter class is not intended for direct use"
    end

passes?(source_file) click to toggle source

    # File lib/simplecov/filter.rb, line 23
    def passes?(source_file)
      warn "DEPRECATION: SimpleCov::Filter#passes?(x) has been renamed to #matches?. Please update your custom filters accordingly!"
      matches?(source_file)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.