Class: Imap::Backup::Account::SerializedFolders
- Inherits:
-
Object
- Object
- Imap::Backup::Account::SerializedFolders
- Includes:
- Enumerable
- Defined in:
- lib/imap/backup/account/serialized_folders.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(account:) ⇒ SerializedFolders
constructor
A new instance of SerializedFolders.
Constructor Details
#initialize(account:) ⇒ SerializedFolders
Returns a new instance of SerializedFolders.
13 14 15 |
# File 'lib/imap/backup/account/serialized_folders.rb', line 13 def initialize(account:) @account = account end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
11 12 13 |
# File 'lib/imap/backup/account/serialized_folders.rb', line 11 def account @account end |
Instance Method Details
#each(&block) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/imap/backup/account/serialized_folders.rb', line 17 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(account.local_path, name) folder = Account::Folder.new(account.client, name) block.call(serializer, folder) end end |