Class: SendPulse::EmailService::Sender

Inherits:
Api
  • Object
show all
Defined in:
lib/sendpulse/email_service/sender.rb

Instance Attribute Summary

Attributes inherited from Api

#client_id, #client_secret, #protocol, #token

Instance Method Summary collapse

Methods inherited from Api

#initialize

Constructor Details

This class inherits a constructor from SendPulse::Api

Instance Method Details

#activate(params) ⇒ Object



22
23
24
# File 'lib/sendpulse/email_service/sender.rb', line 22

def activate(params)
  send_request("#{path_name}/#{params[:email]}/code", 'POST', { code: params[:code] })
end

#create(params) ⇒ Object



10
11
12
# File 'lib/sendpulse/email_service/sender.rb', line 10

def create(params)
  send_request(path_name, 'POST', params)
end

#delete(email) ⇒ Object



14
15
16
# File 'lib/sendpulse/email_service/sender.rb', line 14

def delete(email)
  send_request(path_name, 'DELETE', { email: email })
end

#get_activate_code(email) ⇒ Object



18
19
20
# File 'lib/sendpulse/email_service/sender.rb', line 18

def get_activate_code(email)
  send_request("#{path_name}/#{email}/code", 'GET')
end

#listObject



6
7
8
# File 'lib/sendpulse/email_service/sender.rb', line 6

def list
  send_request(path_name, 'GET')
end

#path_nameObject



26
27
28
# File 'lib/sendpulse/email_service/sender.rb', line 26

def path_name
  "senders"
end