Module: Resend::Broadcasts

Defined in:
lib/resend/broadcasts.rb

Overview

broadcasts api wrapper

Class Method Summary collapse

Class Method Details

.create(params = {}) ⇒ Object



8
9
10
11
# File 'lib/resend/broadcasts.rb', line 8

def create(params = {})
  path = "broadcasts"
  Resend::Request.new(path, params, "post").perform
end

.get(broadcast_id = "") ⇒ Object



38
39
40
41
# File 'lib/resend/broadcasts.rb', line 38

def get(broadcast_id = "")
  path = "broadcasts/#{broadcast_id}"
  Resend::Request.new(path, {}, "get").perform
end

.listObject



26
27
28
29
# File 'lib/resend/broadcasts.rb', line 26

def list
  path = "broadcasts"
  Resend::Request.new(path, {}, "get").perform
end

.remove(broadcast_id = "") ⇒ Object



32
33
34
35
# File 'lib/resend/broadcasts.rb', line 32

def remove(broadcast_id = "")
  path = "broadcasts/#{broadcast_id}"
  Resend::Request.new(path, {}, "delete").perform
end

.send(params = {}) ⇒ Object



20
21
22
23
# File 'lib/resend/broadcasts.rb', line 20

def send(params = {})
  path = "broadcasts/#{params[:broadcast_id]}/send"
  Resend::Request.new(path, params, "post").perform
end

.update(params = {}) ⇒ Object



14
15
16
17
# File 'lib/resend/broadcasts.rb', line 14

def update(params = {})
  path = "broadcasts/#{params[:broadcast_id]}"
  Resend::Request.new(path, params, "patch").perform
end