Class: EmailVision::Campaign

Inherits:
BaseClient show all
Defined in:
lib/email_vision/campaign.rb

Constant Summary

Constants inherited from BaseClient

BaseClient::SESSION_TIMEOUT

Instance Attribute Summary

Attributes inherited from BaseClient

#options

Instance Method Summary collapse

Methods inherited from BaseClient

#api_namespaced, #check_server_status!, #client, #connect!, #connected?, #connection, #execute, #initialize, #request_without_protection

Constructor Details

This class inherits a constructor from EmailVision::BaseClient

Instance Method Details

#create(attributes) ⇒ Object



9
10
11
12
13
# File 'lib/email_vision/campaign.rb', line 9

def create(attributes)
  execute(:create_campaign, format_attributes(attributes))
rescue Savon::SOAP::Fault => e
  nil
end

#delete(id) ⇒ Object



15
16
17
18
19
# File 'lib/email_vision/campaign.rb', line 15

def delete(id)
  execute(:delete_campaign, :id => id)
rescue Savon::SOAP::Fault => e
  check_server_status!(e, "GET_CAMPAIGN_FAILED") { false }
end

#find(id) ⇒ Object



3
4
5
6
7
# File 'lib/email_vision/campaign.rb', line 3

def find(id)
  execute(:get_campaign, :id => id)
rescue Savon::SOAP::Fault => e
  check_server_status!(e, "GET_CAMPAIGN_FAILED") { nil }
end