Class: Imap::Backup::FlagRefresher

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/flag_refresher.rb

Constant Summary collapse

CHUNK_SIZE =
100

Instance Method Summary collapse

Constructor Details

#initialize(folder, serializer) ⇒ FlagRefresher

Returns a new instance of FlagRefresher.



7
8
9
10
# File 'lib/imap/backup/flag_refresher.rb', line 7

def initialize(folder, serializer)
  @folder = folder
  @serializer = serializer
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
# File 'lib/imap/backup/flag_refresher.rb', line 12

def run
  uids = serializer.uids.clone

  uids.each_slice(CHUNK_SIZE) do |block|
    refresh_block block
  end
end