Sha256: 8b99af75ac1fcc46ce3b58d2dc5f1c0b1cceb92b79a019eb7aa1e6fbaab38c25

Contents?: true

Size: 444 Bytes

Versions: 3

Compression:

Stored size: 444 Bytes

Contents

require 'uri'

module Voucherify
  module Service
    class Distributions
      attr_reader :client

      def initialize(client)
        @client = client
      end

      def publish(params)
        payload = {}
        if params.is_a? String
          payload = {:campaign => params}
        elsif params.is_a? Hash
          payload = params
        end

        @client.post('/vouchers/publish', payload.to_json)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
voucherify-1.3.0 lib/voucherify/service/distributions.rb
voucherify-1.2.0 lib/voucherify/service/distributions.rb
voucherify-1.1.0 lib/voucherify/service/distributions.rb