Class: Kameleoon::Conversion
- Inherits:
-
DuplicationSafeData
- Object
- Data
- DuplicationSafeData
- Kameleoon::Conversion
- Defined in:
- lib/kameleoon/data/conversion.rb
Overview
Conversion class uses for tracking conversion
Instance Attribute Summary collapse
-
#goal_id ⇒ Object
readonly
Returns the value of attribute goal_id.
-
#negative ⇒ Object
readonly
Returns the value of attribute negative.
-
#revenue ⇒ Object
readonly
Returns the value of attribute revenue.
Attributes inherited from Data
Instance Method Summary collapse
-
#initialize(goal_id, revenue = 0.0, negative = false) ⇒ Conversion
constructor
A new instance of Conversion.
- #obtain_full_post_text_line ⇒ Object
- #to_s ⇒ Object
Methods inherited from Data
#mark_as_sent, #mark_as_transmitting, #mark_as_unsent, #sent, #transmitting, #unsent
Constructor Details
#initialize(goal_id, revenue = 0.0, negative = false) ⇒ Conversion
Returns a new instance of Conversion.
19 20 21 22 23 24 |
# File 'lib/kameleoon/data/conversion.rb', line 19 def initialize(goal_id, revenue = 0.0, negative = false) super(DataType::CONVERSION) @goal_id = goal_id @revenue = revenue || 0.0 @negative = negative || false end |
Instance Attribute Details
#goal_id ⇒ Object (readonly)
Returns the value of attribute goal_id.
10 11 12 |
# File 'lib/kameleoon/data/conversion.rb', line 10 def goal_id @goal_id end |
#negative ⇒ Object (readonly)
Returns the value of attribute negative.
10 11 12 |
# File 'lib/kameleoon/data/conversion.rb', line 10 def negative @negative end |
#revenue ⇒ Object (readonly)
Returns the value of attribute revenue.
10 11 12 |
# File 'lib/kameleoon/data/conversion.rb', line 10 def revenue @revenue end |
Instance Method Details
#obtain_full_post_text_line ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/kameleoon/data/conversion.rb', line 26 def obtain_full_post_text_line params = { eventType: 'conversion', goalId: @goal_id, revenue: @revenue, negative: @negative, nonce: nonce } Kameleoon::Network::UriHelper.encode_query(params) end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/kameleoon/data/conversion.rb', line 12 def to_s "Conversion{goal_id:#{@goal_id},revenue:#{@revenue},negative:#{@negative}}" end |