Class: RedisCacheMailerDelivery::CacheDelivery

Inherits:
Object
  • Object
show all
Defined in:
lib/redis_cache_mailer_delivery/cache_delivery.rb

Overview

Performs deliveries to redis storage, so mails can accessed from other processes.

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ CacheDelivery

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CacheDelivery.



13
14
15
# File 'lib/redis_cache_mailer_delivery/cache_delivery.rb', line 13

def initialize(settings)
  @settings = Settings.new(settings)
end

Instance Method Details

#deliver!(mail) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
21
22
23
24
# File 'lib/redis_cache_mailer_delivery/cache_delivery.rb', line 18

def deliver!(mail)
  list = Redis::List.new settings.redis_key_name, :marshal => true
  settings.marshallable_converters.each do |setting|
    mail = MarshallableConverterSetting.new(setting).marshallable_class.marshallable(mail)
  end
  list << mail
end