Class: Kameleoon::TargetedSegment

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

Constant Summary collapse

EVENT_TYPE =
'targetingSegment'

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(id) ⇒ TargetedSegment

Returns a new instance of TargetedSegment.



12
13
14
15
# File 'lib/kameleoon/data/targeted_segment.rb', line 12

def initialize(id)
  super(DataType::TARGETED_SEGMENT)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/kameleoon/data/targeted_segment.rb', line 10

def id
  @id
end

Instance Method Details

#obtain_full_post_text_lineObject



17
18
19
20
21
22
23
24
# File 'lib/kameleoon/data/targeted_segment.rb', line 17

def obtain_full_post_text_line
  params = {
    eventType: EVENT_TYPE,
    id: @id,
    nonce: nonce
  }
  Network::UriHelper.encode_query(params)
end

#to_sObject



26
27
28
# File 'lib/kameleoon/data/targeted_segment.rb', line 26

def to_s
  "TargetedSegment{id:#{@id}}"
end