Class: Kameleoon::Interest

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

Instance Attribute Summary collapse

Attributes inherited from Data

#instance, #sent

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ Interest

Returns a new instance of Interest.

Parameters:

  • index (Integer)

    Index of the interest



134
135
136
137
138
# File 'lib/kameleoon/data.rb', line 134

def initialize(index)
  @instance = DataType::INTEREST
  @sent = false
  @index = index
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



131
132
133
# File 'lib/kameleoon/data.rb', line 131

def index
  @index
end

Instance Method Details

#obtain_full_post_text_lineObject



140
141
142
143
# File 'lib/kameleoon/data.rb', line 140

def obtain_full_post_text_line
  nonce = Kameleoon::Utils.generate_random_string(NONCE_LENGTH)
  "eventType=interests&indexes=[" + @index.to_s + "]&fresh=true&nonce=" + nonce
end