Module: ChimpsterDeliveryMethod

Defined in:
lib/chimpster_delivery_method.rb

Overview

This module is only used for Rails 2.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/chimpster_delivery_method.rb', line 14

def self.included(base)
  base.extend(ClassMethods)
  
  base.class_eval do      
    alias_method_chain :create_mail, :chimpster_extras
  end
end

Instance Method Details

#chimpster_attachments(value) ⇒ Object



30
31
32
# File 'lib/chimpster_delivery_method.rb', line 30

def chimpster_attachments(value)
  @attachments = value
end

#create_mail_with_chimpster_extrasObject



34
35
36
37
38
39
# File 'lib/chimpster_delivery_method.rb', line 34

def create_mail_with_chimpster_extras
  create_mail_without_chimpster_extras.tap do |mail|
    mail.tag = @tag                          if @tag
    mail.chimpster_attachments = @attachments if @attachments
  end
end

#perform_delivery_chimpster(message) ⇒ Object



22
23
24
# File 'lib/chimpster_delivery_method.rb', line 22

def perform_delivery_chimpster(message)
  Chimpster.send_through_chimpster(message)
end

#tag(value) ⇒ Object



26
27
28
# File 'lib/chimpster_delivery_method.rb', line 26

def tag(value)
  @tag = value
end