Sha256: 0e2232c6b154a3e83e51805faa334dc58dd2d7208713c292a4ddbca60f74fc34

Contents?: true

Size: 803 Bytes

Versions: 25

Compression:

Stored size: 803 Bytes

Contents

require 'stream/url'

module Stream
  class PersonalizationClient < Client
    def url_generator
      PersonalizationURLGenerator.new(@client_options)
    end

    def get(resource, params = {})
      make_personalization_request(:get, resource, params, {})
    end

    def post(resource, params = {}, data = {})
      make_personalization_request(:post, resource, params, data: data)
    end

    def delete(resource, params = {})
      make_personalization_request(:delete, resource, params, {})
    end

    private

    def make_personalization_request(method, resource, params, data)
      endpoint = "/#{resource}/"
      auth_token = Stream::Signer.create_jwt_token('personalization', '*', @api_secret, '*', '*')
      make_request(method, endpoint, auth_token, params, data)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
stream-ruby-5.1.0 lib/stream/personalization.rb
stream-ruby-5.0.0 lib/stream/personalization.rb
stream-ruby-4.6.0 lib/stream/personalization.rb
stream-ruby-4.5.0 lib/stream/personalization.rb
stream-ruby-4.4.0 lib/stream/personalization.rb
stream-ruby-4.3.0 lib/stream/personalization.rb
stream-ruby-4.2.0 lib/stream/personalization.rb
stream-ruby-4.1.0 lib/stream/personalization.rb
stream-ruby-4.0.2 lib/stream/personalization.rb
stream-ruby-4.0.1 lib/stream/personalization.rb
stream-ruby-4.0.0 lib/stream/personalization.rb
stream-ruby-3.1.0 lib/stream/personalization.rb
stream-ruby-3.0.1 lib/stream/personalization.rb
stream-ruby-3.0.0 lib/stream/personalization.rb
stream-ruby-2.11.0 lib/stream/personalization.rb
stream-ruby-2.10.0 lib/stream/personalization.rb
stream-ruby-2.9.3 lib/stream/personalization.rb
stream-ruby-2.9.2 lib/stream/personalization.rb
stream-ruby-2.9.1 lib/stream/personalization.rb
stream-ruby-2.9.0 lib/stream/personalization.rb