Sha256: 6e7bbc46aab41c5d36f75dd7d459ab4f92891a83c650ed2004f1060e3197349f

Contents?: true

Size: 694 Bytes

Versions: 6

Compression:

Stored size: 694 Bytes

Contents

require 'ns-options'
require 'ns-options/boolean'
require 'inbox-sync/config/credentials'

module InboxSync; end
class InboxSync::Config

  class IMAPConfig
    include NsOptions::Proxy

    opt :host, :required => true
    opt :port, :default => 143, :required => true
    opt :ssl, NsOptions::Boolean, :default => false, :required => true
    opt :login, Credentials, :required => true, :default => {}
    opt :inbox, :default => "INBOX", :required => true
    opt :expunge, NsOptions::Boolean, :default => true, :required => true

    def validate!
      if !required_set?
        raise ArgumentError, "some required configs are missing"
      end

      login.validate!
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
inbox-sync-0.4.1 lib/inbox-sync/config/imap_config.rb
inbox-sync-0.4.0 lib/inbox-sync/config/imap_config.rb
inbox-sync-0.3.0 lib/inbox-sync/config/imap_config.rb
inbox-sync-0.2.1 lib/inbox-sync/config/imap_config.rb
inbox-sync-0.2.0 lib/inbox-sync/config/imap_config.rb
inbox-sync-0.1.0 lib/inbox-sync/config/imap_config.rb