Sha256: 910b4ceb153bea45f3cc3b2a838aef7ff13b313f166ac7db1659a9b66d89c1ea

Contents?: true

Size: 536 Bytes

Versions: 7

Compression:

Stored size: 536 Bytes

Contents

# frozen_string_literal: true

module RDStation
  class Events
    include HTTParty
    include ::RDStation::RetryableRequest

    def initialize(authorization:)
      @authorization = authorization
    end

    def create(payload)
      retryable_request(@authorization) do |authorization|
        response = self.class.post(base_url, headers: authorization.headers, body: payload.to_json)
        ApiResponse.build(response)
      end
    end

    private

    def base_url
      "#{RDStation.host}/platform/events"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rdstation-ruby-client-2.9.0 lib/rdstation/events.rb
rdstation-ruby-client-2.8.2 lib/rdstation/events.rb
rdstation-ruby-client-2.8.1 lib/rdstation/events.rb
rdstation-ruby-client-2.8.0 lib/rdstation/events.rb
rdstation-ruby-client-2.7.0 lib/rdstation/events.rb
rdstation-ruby-client-2.6.0 lib/rdstation/events.rb
rdstation-ruby-client-2.5.3 lib/rdstation/events.rb