Class: Kameleoon::Device

Inherits:
DuplicationUnsafeData 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

Instance Method Summary collapse

Methods inherited from Data

#mark_as_sent, #mark_as_transmitting, #mark_as_unsent, #sent, #transmitting, #unsent

Constructor Details

#initialize(device_type) ⇒ Device

Returns a new instance of Device.



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

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.



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

def device_type
  @device_type
end

Instance Method Details

#obtain_full_post_text_lineObject



27
28
29
30
31
32
33
34
# File 'lib/kameleoon/data/device.rb', line 27

def obtain_full_post_text_line
  params = {
    eventType: 'staticData',
    deviceType: @device_type,
    nonce: nonce
  }
  Kameleoon::Network::UriHelper.encode_query(params)
end

#to_sObject



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

def to_s
  "Device{device_type:#{@device_type}}"
end