Class: CleanUp::Conditions::Size

Inherits:
Object
  • Object
show all
Defined in:
lib/clean_up/conditions/size.rb

Overview

TODO: size conditions format

Instance Method Summary collapse

Constructor Details

#initialize(*value) ⇒ Size

Returns a new instance of Size.



5
6
7
# File 'lib/clean_up/conditions/size.rb', line 5

def initialize(*value)
  @pattern = parse(value.first)
end

Instance Method Details

#match?(file) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/clean_up/conditions/size.rb', line 9

def match?(file)
  @pattern.cover?(File.size(file))
end