Sha256: 7dc2776efbe839baf017b07fde5b7f221b4bc9c6c2fa601f50e9b5a1fa2c7cfd
Contents?: true
Size: 708 Bytes
Versions: 20
Compression:
Stored size: 708 Bytes
Contents
module MList module EmailServer class Base attr_reader :settings def initialize(settings) @settings = { :domain => ::Socket.gethostname }.merge(settings) @uuid = UUID.new @receivers = [] end def deliver(tmail) raise 'Implement actual delivery mechanism in subclasses' end def generate_message_id "#{@uuid.generate}@#{@settings[:domain]}" 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
20 entries across 20 versions & 2 rubygems