Sha256: 3eafa1fd43f7fc4162fb39d41f9f3795bf1d68c3fa44ec38b479dd20441f5ad6

Contents?: true

Size: 783 Bytes

Versions: 3

Compression:

Stored size: 783 Bytes

Contents

module MList
  module EmailServer
    
    class Default < Base
      def initialize(incoming_server, outgoing_server)
        super({})
        @incoming_server, @outgoing_server = incoming_server, outgoing_server
        @incoming_server.receiver(self)
      end
      
      # Delegates delivery of email to outgoing server.
      #
      def deliver(tmail, destinations)
        @outgoing_server.deliver(tmail, destinations)
      end
      
      # Delegates fetching emails to incoming server.
      def execute
        @incoming_server.execute
      end
      
      # Delegates processing of email from incoming server to receivers on
      # self.
      #
      def receive_email(email)
        @receivers.each { |r| r.receive_email(email) }
      end
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aiwilliams-mlist-0.1.0 lib/mlist/email_server/default.rb
aiwilliams-mlist-0.1.1 lib/mlist/email_server/default.rb
aiwilliams-mlist-0.1.2 lib/mlist/email_server/default.rb