Class: Imap::Backup::Account::SerializedFolders

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/imap/backup/account/serialized_folders.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account:) ⇒ SerializedFolders

Returns a new instance of SerializedFolders.



17
18
19
# File 'lib/imap/backup/account/serialized_folders.rb', line 17

def initialize(account:)
  @account = 
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



15
16
17
# File 'lib/imap/backup/account/serialized_folders.rb', line 15

def 
  @account
end

Instance Method Details

#each(&block) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/imap/backup/account/serialized_folders.rb', line 21

def each(&block)
  return enum_for(:each) if !block

  glob.each do |path|
    name = path.relative_path_from(base).to_s[0..-6]
    serializer = Serializer.new(.local_path, name)
    folder = Account::Folder.new(.client, name)
    block.call(serializer, folder)
  end
end