Class: Exacto::MasterListUnsubscription

Inherits:
Unsubscription show all
Defined in:
lib/exacto_subscriber/master_list_unsubscription.rb

Instance Attribute Summary

Attributes inherited from Unsubscription

#email_address, #status, #unsubscribed_at

Class Method Summary collapse

Methods inherited from Unsubscription

#initialize, #response_system_name

Constructor Details

This class inherits a constructor from Exacto::Unsubscription

Class Method Details

.find(start_date, end_date) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/exacto_subscriber/master_list_unsubscription.rb', line 3

def self.find(start_date, end_date)
  response = issue_request("tracking") do |xml|
    xml.action "retrieve"
    xml.sub_action "masterunsub"
    xml.search_type ""
    xml.search_value ""
    xml.daterange do
      xml.startdate format_date_for_request(start_date)
      xml.enddate   format_date_for_request(end_date)
    end
  end

  response = [response] if response.is_a?(Hash) && !response.empty?
  response.collect do |i|
    new(normalize(i))
  end
end

.request_system_nameObject



25
26
27
# File 'lib/exacto_subscriber/master_list_unsubscription.rb', line 25

def self.request_system_name
  "tracking"
end

.response_system_nameObject



29
30
31
# File 'lib/exacto_subscriber/master_list_unsubscription.rb', line 29

def self.response_system_name
  "subscriber"
end

.trim_response(response) ⇒ Object



21
22
23
# File 'lib/exacto_subscriber/master_list_unsubscription.rb', line 21

def self.trim_response(response)
  super(response)["tracking"]["masterunsub"]
end