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

Instance Method Summary collapse

Methods inherited from Data

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

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



60
61
62
63
# File 'lib/kameleoon/data/operating_system.rb', line 60

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



65
66
67
68
69
70
71
72
73
# File 'lib/kameleoon/data/operating_system.rb', line 65

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

#to_sObject



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

def to_s
  "OperatingSystem{os_type:#{@os_type}}"
end