Class: CleanUp::Conditions::Name
- Inherits:
-
Object
- Object
- CleanUp::Conditions::Name
- Defined in:
- lib/clean_up/conditions/name.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ Name
constructor
A new instance of Name.
- #match?(file) ⇒ Boolean
Constructor Details
#initialize(value) ⇒ Name
Returns a new instance of Name.
4 5 6 |
# File 'lib/clean_up/conditions/name.rb', line 4 def initialize(value) @pattern = Array(value) end |
Instance Method Details
#match?(file) ⇒ Boolean
8 9 10 11 12 |
# File 'lib/clean_up/conditions/name.rb', line 8 def match?(file) @pattern.any? do |filename| filename == File.basename(file, '.*') end end |