Sha256: 505be7a21eb63976ebbc1d622c01c49064a236a45cd624660de09cffc78d0177
Contents?: true
Size: 801 Bytes
Versions: 4
Compression:
Stored size: 801 Bytes
Contents
# encoding: utf-8 module Imap::Backup::Configuration class List attr_reader :accounts def initialize(accounts = nil) if not Imap::Backup::Configuration::Store.exist? raise Imap::Backup::ConfigurationNotFound.new("Configuration file '#{Imap::Backup::Configuration::Store.default_pathname}' not found") end @config = Imap::Backup::Configuration::Store.new if accounts.nil? @accounts = @config.data[:accounts] else @accounts = @config.data[:accounts].select{ |account| accounts.include?(account[:username]) } end end def each_connection @accounts.each do |account| connection = Imap::Backup::Account::Connection.new(account) yield connection connection.disconnect end end end end
Version data entries
4 entries across 4 versions & 1 rubygems