Class: Kameleoon::OperatingSystem

Inherits:
DuplicationUnsafeData show all
Defined in:
lib/kameleoon/data/operating_system.rb

Overview

OperatingSystem contains information about the operating system on the visitor’s device

Instance Attribute Summary collapse

Attributes inherited from Data

#instance, #sent

Instance Method Summary collapse

Methods inherited from Data

#mark_as_sent

Constructor Details

#initialize(os_type) ⇒ OperatingSystem

Returns a new instance of OperatingSystem.

Parameters:

  • os_type (OperatingSystemType)

    Operating system type, can be: WINDOWS, MAC, IOS, LINUX, ANDROID, WINDOWS_PHONE



56
57
58
59
# File 'lib/kameleoon/data/operating_system.rb', line 56

def initialize(os_type)
  super(DataType::OPERATING_SYSTEM)
  @os_type = os_type
end

Instance Attribute Details

#os_typeObject (readonly)

Returns the value of attribute os_type.



53
54
55
# File 'lib/kameleoon/data/operating_system.rb', line 53

def os_type
  @os_type
end

Instance Method Details

#obtain_full_post_text_lineObject



61
62
63
64
65
66
67
68
69
# File 'lib/kameleoon/data/operating_system.rb', line 61

def obtain_full_post_text_line
  params = {
    eventType: 'staticData',
    os: OperatingSystemType.name_from_type(@os_type),
    osIndex: @os_type,
    nonce: nonce
  }
  Kameleoon::Network::UriHelper.encode_query(params)
end