Sha256: 14e0af365a7629db708bffd7aedf422add631e50af4f8b486ce0aaeb8ef474fb

Contents?: true

Size: 431 Bytes

Versions: 11

Compression:

Stored size: 431 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/#{URI.encode(id)}")
      end

      def delete(id)
        @client.delete("/segments/#{URI.encode(id)}")
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
voucherify-3.0.0 lib/voucherify/service/segments.rb
voucherify-2.4.0 lib/voucherify/service/segments.rb
voucherify-2.3.0 lib/voucherify/service/segments.rb
voucherify-2.2.0 lib/voucherify/service/segments.rb
voucherify-2.1.1 lib/voucherify/service/segments.rb
voucherify-2.1.0 lib/voucherify/service/segments.rb
voucherify-2.0.0 lib/voucherify/service/segments.rb
voucherify-1.6.1 lib/voucherify/service/segments.rb
voucherify-1.6.0 lib/voucherify/service/segments.rb
voucherify-1.5.0 lib/voucherify/service/segments.rb
voucherify-1.4.0 lib/voucherify/service/segments.rb