Class: Frizz::Ignorance
- Inherits:
-
Object
- Object
- Frizz::Ignorance
- Defined in:
- lib/frizz/ignorance.rb
Instance Attribute Summary collapse
-
#patterns ⇒ Object
readonly
Returns the value of attribute patterns.
Instance Method Summary collapse
- #ignore?(path) ⇒ Boolean
-
#initialize(patterns) ⇒ Ignorance
constructor
A new instance of Ignorance.
Constructor Details
#initialize(patterns) ⇒ Ignorance
Returns a new instance of Ignorance.
5 6 7 |
# File 'lib/frizz/ignorance.rb', line 5 def initialize(patterns) @patterns = patterns || [] end |
Instance Attribute Details
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
3 4 5 |
# File 'lib/frizz/ignorance.rb', line 3 def patterns @patterns end |
Instance Method Details
#ignore?(path) ⇒ Boolean
9 10 11 12 |
# File 'lib/frizz/ignorance.rb', line 9 def ignore?(path) return false unless patterns.count patterns.any? { |p| ::File.fnmatch(p, path) } end |