class RDStation::Segmentations

Public Class Methods

new(authorization:) click to toggle source
# File lib/rdstation/segmentations.rb, line 6
def initialize(authorization:)
  @authorization = authorization
end

Public Instance Methods

all() click to toggle source
# File lib/rdstation/segmentations.rb, line 10
def all
  retryable_request(@authorization) do |authorization|
    response = self.class.get(base_url, headers: authorization.headers)
    ApiResponse.build(response)
  end
end
contacts(segmentation_id) click to toggle source
# File lib/rdstation/segmentations.rb, line 17
def contacts(segmentation_id)
  retryable_request(@authorization) do |authorization|
    response = self.class.get(base_url("#{segmentation_id}/contacts"), headers: authorization.headers)
    ApiResponse.build(response)
  end
end

Private Instance Methods

base_url(path = '') click to toggle source
# File lib/rdstation/segmentations.rb, line 26
def base_url(path = '')
  "#{RDStation.host}/platform/segmentations/#{path}"
end