Class: Covered::Skip

Inherits:
Filter show all
Defined in:
lib/covered/files.rb

Instance Attribute Summary collapse

Attributes inherited from Wrapper

#output

Instance Method Summary collapse

Methods inherited from Filter

#accept?, #each, #mark

Methods inherited from Wrapper

#accept?, #disable, #each, #enable, #expand_path, #mark, #relative_path, #to_h

Methods inherited from Base

#accept?, #disable, #each, #enable, #expand_path, #mark, #relative_path

Constructor Details

#initialize(output, pattern) ⇒ Skip

Returns a new instance of Skip.



93
94
95
96
97
# File 'lib/covered/files.rb', line 93

def initialize(output, pattern)
	super(output)
	
	@pattern = pattern
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



99
100
101
# File 'lib/covered/files.rb', line 99

def pattern
  @pattern
end

Instance Method Details

#match?(path) ⇒ Boolean

This is better as it doesn’t allocate a MatchData instance which is essentially useless.

Returns:

  • (Boolean)


103
104
105
# File 'lib/covered/files.rb', line 103

def match? path
	!@pattern.match?(path)
end