Module: Resend::Segments

Defined in:
lib/resend/segments.rb

Overview

Segments api wrapper

Class Method Summary collapse

Class Method Details

.create(params) ⇒ Object



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

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

.get(segment_id = "") ⇒ Object



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

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

.list(params = {}) ⇒ Object



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

def list(params = {})
  path = Resend::PaginationHelper.build_paginated_path("segments", params)
  Resend::Request.new(path, {}, "get").perform
end

.remove(segment_id = "") ⇒ Object



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

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