Class: LetterStampMailDelivery::DeliveryMethod

Inherits:
Mail::TestMailer
  • Object
show all
Defined in:
lib/letter_stamp_mail_delivery/delivery_method.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ DeliveryMethod

Returns a new instance of DeliveryMethod.



26
27
28
29
30
31
# File 'lib/letter_stamp_mail_delivery/delivery_method.rb', line 26

def initialize(settings)
  super
  self.settings = {
    :delivery_location => "#{tmpdir}/letter_stamp_mails",
  }.update(settings)
end

Class Attribute Details

.posting_locationObject

Returns the value of attribute posting_location.



8
9
10
# File 'lib/letter_stamp_mail_delivery/delivery_method.rb', line 8

def posting_location
  @posting_location
end

Class Method Details

.increment_mail_countObject



20
21
22
# File 'lib/letter_stamp_mail_delivery/delivery_method.rb', line 20

def increment_mail_count
  @mail_counts[posting_location] += 1
end

.mail_countObject



15
16
17
# File 'lib/letter_stamp_mail_delivery/delivery_method.rb', line 15

def self.mail_count
  @mail_counts[posting_location]
end

.startObject



11
12
13
# File 'lib/letter_stamp_mail_delivery/delivery_method.rb', line 11

def self.start
  @mail_counts = Hash.new(0)
end

Instance Method Details

#deliver!(mail) ⇒ Object



33
34
35
36
# File 'lib/letter_stamp_mail_delivery/delivery_method.rb', line 33

def deliver!(mail)
  super
  save_raw_mail(mail.encoded)
end