cartodb-4.42/lib/carto/tracking/services/segment.rb

21 lines
495 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
module Carto
module Tracking
module Services
module Segment
def report_to_segment
return unless segment_api_key
segment_job = Resque::TrackingJobs::SendSegmentEvent
supplied_properties = @format.to_segment
Resque.enqueue(segment_job, @reporter.try(:id), name, supplied_properties)
end
def segment_api_key
@segment_api_key ||= Cartodb.get_config(:segment, 'api_key')
end
end
end
end
end