Sha256: 49fb12363cd19626d4c8b9619ca3b2532994c66d8a2fe5bdcf2f3bea948ad322

Contents?: true

Size: 405 Bytes

Versions: 2

Compression:

Stored size: 405 Bytes

Contents

module SimpleSegment
  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]

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_segment-0.2.1 lib/simple_segment/operations/track.rb
simple_segment-0.2.0 lib/simple_segment/operations/track.rb