Class: Kameleoon::Device

Inherits:
Data
  • Object
show all
Defined in:
lib/kameleoon/data/device.rb

Overview

Device uses for sending deviceType parameter for tracking calls

Instance Attribute Summary collapse

Attributes inherited from Data

#instance, #sent

Instance Method Summary collapse

Methods inherited from Data

encode

Constructor Details

#initialize(device_type) ⇒ Device

Returns a new instance of Device.



16
17
18
19
# File 'lib/kameleoon/data/device.rb', line 16

def initialize(device_type)
  super(DataType::DEVICE)
  @device_type = device_type
end

Instance Attribute Details

#device_typeObject (readonly)

Returns the value of attribute device_type.



15
16
17
# File 'lib/kameleoon/data/device.rb', line 15

def device_type
  @device_type
end

Instance Method Details

#obtain_full_post_text_lineObject



21
22
23
24
# File 'lib/kameleoon/data/device.rb', line 21

def obtain_full_post_text_line
  nonce = Kameleoon::Utils.generate_random_string(NONCE_LENGTH)
  "eventType=staticData&deviceType=#{@device_type}&nonce=#{nonce}"
end