Module: Millionsend::Topics
- Defined in:
- lib/millionsend/topics.rb
Overview
Subscription topics — granular unsubscribe categories.
Class Method Summary collapse
-
.create(params) ⇒ Object
POST /topics — name, default_subscription, description, visibility.
-
.get(id) ⇒ Object
GET /topics/:id.
-
.list ⇒ Object
GET /topics — a bare { data: [...] } (topics are unpaginated).
-
.remove(id) ⇒ Object
DELETE /topics/:id.
-
.update(id, params) ⇒ Object
PATCH /topics/:id — name, description, visibility.
Class Method Details
.create(params) ⇒ Object
POST /topics — name, default_subscription, description, visibility.
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 |
.list ⇒ Object
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
28 29 30 |
# File 'lib/millionsend/topics.rb', line 28 def remove(id) Millionsend::Request.new(method: :delete, path: "/topics/#{Millionsend::Util.encode(id)}").perform end |
.update(id, params) ⇒ Object
PATCH /topics/:id — name, description, visibility.
23 24 25 |
# File 'lib/millionsend/topics.rb', line 23 def update(id, params) Millionsend::Request.new(method: :patch, path: "/topics/#{Millionsend::Util.encode(id)}", body: params).perform end |