Class: Imagesorter::Categorizers::FileStatCategorizer

Inherits:
Object
  • Object
show all
Defined in:
lib/imagesorter/categorizers/file_stat_categorizer.rb

Instance Method Summary collapse

Constructor Details

#initialize(stat) ⇒ FileStatCategorizer

Returns a new instance of FileStatCategorizer.



6
7
8
# File 'lib/imagesorter/categorizers/file_stat_categorizer.rb', line 6

def initialize(stat)
  @stat = stat
end

Instance Method Details

#process(file) ⇒ Object



10
11
12
13
14
15
# File 'lib/imagesorter/categorizers/file_stat_categorizer.rb', line 10

def process(file)
  time = file.file.send(@stat)
  return nil if time.nil?

  file.time = time
end