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

#each, #mark

Methods inherited from Wrapper

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

Constructor Details

#initialize(output, pattern) ⇒ Only

Returns a new instance of Only.



131
132
133
134
135
# File 'lib/covered/files.rb', line 131

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

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



137
138
139
# File 'lib/covered/files.rb', line 137

def pattern
  @pattern
end

Instance Method Details

#accept?(path) ⇒ Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/covered/files.rb', line 139

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