Sha256: df013e1160e588ae141ded99186efa673b0beea0aa74e7e54ad0111916c4afc7

Contents?: true

Size: 451 Bytes

Versions: 2

Compression:

Stored size: 451 Bytes

Contents

require 'uri'

module Voucherify
  module Service
    class Segments
      attr_reader :client

      def initialize(client)
        @client = client
      end

      def create(segment)
        @client.post('/segments', segment.to_json)
      end

      def get(id)
        @client.get("/segments/#{ERB::Util.url_encode(id)}")
      end

      def delete(id)
        @client.delete("/segments/#{ERB::Util.url_encode(id)}")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voucherify-4.1.0 lib/voucherify/service/segments.rb
voucherify-4.0.0 lib/voucherify/service/segments.rb