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, #calculateOffset

Constructor Details

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

Returns a new instance of TCellFingerprintSensorEvent.



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

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



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

def post_process
    if !(@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
    if @user_id
        self["uid"] = @user_id
    end
end