Module: Millionsend::Topics

Defined in:
lib/millionsend/topics.rb

Overview

Subscription topics — granular unsubscribe categories.

Class Method Summary collapse

Class Method Details

.create(params) ⇒ Object

POST /topics



8
9
10
# File 'lib/millionsend/topics.rb', line 8

def create(params)
  Millionsend::Request.new(method: :post, path: "/topics", body: params).perform
end

.get(id) ⇒ Object

GET /topics/:id



13
14
15
# File 'lib/millionsend/topics.rb', line 13

def get(id)
  Millionsend::Request.new(method: :get, path: "/topics/#{Millionsend::Util.encode(id)}").perform
end

.listObject

GET /topics — a bare { data: [...] } (topics are unpaginated).



18
19
20
# File 'lib/millionsend/topics.rb', line 18

def list
  Millionsend::Request.new(method: :get, path: "/topics").perform
end

.remove(id) ⇒ Object

DELETE /topics/:id



23
24
25
# File 'lib/millionsend/topics.rb', line 23

def remove(id)
  Millionsend::Request.new(method: :delete, path: "/topics/#{Millionsend::Util.encode(id)}").perform
end