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

Constructor Details

#initialize(output, pattern) ⇒ Only

Returns a new instance of Only.



123
124
125
126
127
# File 'lib/covered/files.rb', line 123

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

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



129
130
131
# File 'lib/covered/files.rb', line 129

def pattern
  @pattern
end

Instance Method Details

#accept?(path) ⇒ Boolean

Returns:

  • (Boolean)


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

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