Module: Millionsend::Segments
- Defined in:
- lib/millionsend/segments.rb
Overview
Dynamic segments — a saved filter over the team's contacts. A MillionSend extension with no Resend equivalent.
Class Method Summary collapse
-
.create(params) ⇒ Object
POST /segments.
-
.get(id) ⇒ Object
GET /segments/:id — also returns a live contact_count.
-
.list(options = {}) ⇒ Object
GET /segments — accepts limit:/after:/before:.
-
.remove(id) ⇒ Object
DELETE /segments/:id.
-
.update(id, params) ⇒ Object
PATCH /segments/:id.
Class Method Details
.create(params) ⇒ Object
POST /segments
9 10 11 |
# File 'lib/millionsend/segments.rb', line 9 def create(params) Millionsend::Request.new(method: :post, path: "/segments", body: params).perform end |
.get(id) ⇒ Object
GET /segments/:id — also returns a live contact_count.
14 15 16 |
# File 'lib/millionsend/segments.rb', line 14 def get(id) Millionsend::Request.new(method: :get, path: "/segments/#{Millionsend::Util.encode(id)}").perform end |
.list(options = {}) ⇒ Object
GET /segments — accepts limit:/after:/before:.
19 20 21 22 23 |
# File 'lib/millionsend/segments.rb', line 19 def list( = {}) Millionsend::Request.new( method: :get, path: "/segments", query: Millionsend::Util.list_query() ).perform end |
.remove(id) ⇒ Object
DELETE /segments/:id
31 32 33 |
# File 'lib/millionsend/segments.rb', line 31 def remove(id) Millionsend::Request.new(method: :delete, path: "/segments/#{Millionsend::Util.encode(id)}").perform end |
.update(id, params) ⇒ Object
PATCH /segments/:id
26 27 28 |
# File 'lib/millionsend/segments.rb', line 26 def update(id, params) Millionsend::Request.new(method: :patch, path: "/segments/#{Millionsend::Util.encode(id)}", body: params).perform end |