Class: Covered::Only

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, #flush, #mark, #relative_path, #to_h

Methods inherited from Base

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

Constructor Details

#initialize(output, pattern) ⇒ Only

Returns a new instance of Only.



114
115
116
117
118
# File 'lib/covered/files.rb', line 114

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

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



120
121
122
# File 'lib/covered/files.rb', line 120

def pattern
  @pattern
end

Instance Method Details

#match?(path) ⇒ Boolean

Returns:

  • (Boolean)


122
123
124
# File 'lib/covered/files.rb', line 122

def match?(path)
	@pattern === path
end