Class: DataHoover::Nozzle

Inherits:
Object
  • Object
show all
Defined in:
lib/data_hoover/nozzle.rb

Instance Method Summary collapse

Constructor Details

#initialize(trackee:, bag: DataHoover::Bags::SegmentAnalytics) ⇒ Nozzle

Returns a new instance of Nozzle.



4
5
6
7
# File 'lib/data_hoover/nozzle.rb', line 4

def initialize(trackee:, bag: DataHoover::Bags::SegmentAnalytics)
  @trackee = trackee
  @bag = bag
end

Instance Method Details

#absorb(event, props = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/data_hoover/nozzle.rb', line 9

def absorb(event, props={})
  @bag.tag(
    trackee_id: DataHoover.anon(@trackee.id),
    traits: traits
  )
  @bag.wrap(
    trackee_id: DataHoover.anon(@trackee.id),
    event: event,
    properties: props
  )
end