Class: Filtering::MatchRegex

Inherits:
Filter
  • Object
show all
Defined in:
lib/file_filter.rb

Instance Attribute Summary

Attributes inherited from Filter

#predicates

Instance Method Summary collapse

Methods inherited from Filter

#apply, #chain, #filter

Constructor Details

#initialize(regex) ⇒ MatchRegex

Returns a new instance of MatchRegex.



65
66
67
68
69
70
# File 'lib/file_filter.rb', line 65

def initialize regex
  @predicates = []
  @predicates << proc do |path|
    path.match(regex) ? true : false
  end
end