Class: TCellAgent::SensorEvents::TCellFingerprintSensorEvent

Inherits:
TCellSensorEvent
  • Object
show all
Defined in:
lib/tcell_agent/sensor_events/sensor.rb

Instance Attribute Summary

Attributes inherited from TCellSensorEvent

#ensure, #flush, #send

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculate_offset

Constructor Details

#initialize(request, hmac_session_id, user_id = nil) ⇒ TCellFingerprintSensorEvent

Returns a new instance of TCellFingerprintSensorEvent.



72
73
74
75
76
77
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 72

def initialize(request, hmac_session_id, user_id = nil)
  super('fingerprint')
  @raw_request = request
  @hmac_session_id = hmac_session_id
  @user_id = user_id
end

Instance Method Details

#post_processObject



79
80
81
82
83
84
85
86
87
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 79

def post_process
  unless @raw_request.headers.key?('HTTP_USER_AGENT')
    raise 'User Agent not Found!'
  end
  self['ua'] = @raw_request.headers['HTTP_USER_AGENT']
  self['ip'] = @raw_request.remote_ip
  self['sid'] = @hmac_session_id
  self['uid'] = @user_id if @user_id
end