Sha256: 7d20f1d59808829f868fca94b1047043b9e1a456280ed8f02003a3189d715d1c

Contents?: true

Size: 520 Bytes

Versions: 7

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

module RudderAnalyticsSync
  module Operations
    class Track < Operation
      def call
        request.post('/v1/track', build_payload)
      end

      def build_payload
        raise ArgumentError, 'event name must be present' \
          unless options[:event]

        properties = options[:properties] && isoify_dates!(options[:properties])

        base_payload.merge(
          event: options[:event],
          properties: properties || {}
        )
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rudder_analytics_sync-1.0.7 lib/rudder_analytics_sync/operations/track.rb
rudder_analytics_sync-1.0.6 lib/rudder_analytics_sync/operations/track.rb
rudder_analytics_sync-1.0.5 lib/rudder_analytics_sync/operations/track.rb
rudder_analytics_sync-1.0.4 lib/rudder_analytics_sync/operations/track.rb
rudder_analytics_sync-1.0.3 lib/rudder_analytics_sync/operations/track.rb
rudder_analytics_sync-1.0.2 lib/rudder_analytics_sync/operations/track.rb
rudder_analytics_sync-1.0.1 lib/rudder_analytics_sync/operations/track.rb