Class: ActorSync::Adapters::Segment

Inherits:
Object
  • Object
show all
Defined in:
lib/actor_sync/adapters/segment.rb

Instance Method Summary collapse

Constructor Details

#initialize(actor) ⇒ Segment

Returns a new instance of Segment.



6
7
8
# File 'lib/actor_sync/adapters/segment.rb', line 6

def initialize(actor)
  @actor = actor
end

Instance Method Details

#sendObject



10
11
12
13
# File 'lib/actor_sync/adapters/segment.rb', line 10

def send
  analytics = Segment::Analytics.new(write_key: ENV['SEGMENT_WRITE_KEY'])
  analytics.identify(@actor.id, traits: data)
end