Sha256: a7e30acb5c15677c573490c9c722c0c8a965232cc84714962cde45aa190f8546

Contents?: true

Size: 530 Bytes

Versions: 3

Compression:

Stored size: 530 Bytes

Contents

module MList
  module EmailServer
    class Base
      attr_reader :settings
      
      def initialize(settings)
        @settings = settings
        @receivers = []
      end
      
      def deliver(tmail, destinations)
        raise 'Implement actual delivery mechanism in subclasses'
      end
      
      def receive(tmail)
        email = MList::Email.new(:tmail => tmail)
        @receivers.each { |r| r.receive_email(email) }
      end
      
      def receiver(rx)
        @receivers << rx
      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/base.rb
aiwilliams-mlist-0.1.1 lib/mlist/email_server/base.rb
aiwilliams-mlist-0.1.2 lib/mlist/email_server/base.rb