Class: Imap::Backup::FlagRefresher

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

Constant Summary collapse

CHUNK_SIZE =
100

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(folder, serializer) ⇒ FlagRefresher

Returns a new instance of FlagRefresher.


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

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

Instance Attribute Details

#folderObject (readonly)

Returns the value of attribute folder.


3
4
5
# File 'lib/imap/backup/flag_refresher.rb', line 3

def folder
  @folder
end

#serializerObject (readonly)

Returns the value of attribute serializer.


4
5
6
# File 'lib/imap/backup/flag_refresher.rb', line 4

def serializer
  @serializer
end

Instance Method Details

#runObject


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

def run
  uids = serializer.uids.clone

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