lib/soapy_cake/const.rb in soapy_cake-1.14.0 vs lib/soapy_cake/const.rb in soapy_cake-1.14.1
- old
+ new
@@ -1,19 +1,32 @@
module SoapyCake
module Const
+ # The ID mapping in the API docs is wrong, these values are taken from the UI.
+ CONVERSION_BEHAVIOUR_ID = {
+ system: 0,
+ adv_off: 1,
+ adv_no_aff: 2,
+ no_adv_aff: 3,
+ no_adv_no_aff: 4,
+ ignore: 5
+ }.freeze
+
+ OFFER_STATUS_ID = {
+ public: 1,
+ private: 2,
+ apply_to_run: 3,
+ inactive: 4
+ }.freeze
+
CONSTS = {
account_status_id: {
active: 1,
inactive: 2,
pending: 3
},
- offer_status_id: {
- public: 1,
- private: 2,
- apply_to_run: 3,
- inactive: 4
- },
+ offer_status_id: OFFER_STATUS_ID,
+ status_id: OFFER_STATUS_ID,
offer_type_id: {
hosted: 1,
host_n_post: 2,
third_party: 3
},
@@ -34,19 +47,13 @@
cpc: 2,
cpm: 3,
fixed: 4,
revshare: 5
},
- # The ID mapping in the API docs is wrong, these values are taken from the UI.
- conversion_behavior_id: {
- system: 0,
- adv_off: 1,
- adv_no_aff: 2,
- no_adv_aff: 3,
- no_adv_no_aff: 4,
- ignore: 5
- },
+ conversion_behavior_id: CONVERSION_BEHAVIOUR_ID,
+ conversion_cap_behavior: CONVERSION_BEHAVIOUR_ID,
+ conversion_behavior_on_redirect: CONVERSION_BEHAVIOUR_ID,
cap_type_id: {
click: 1,
conversion: 2
},
cap_interval_id: {
@@ -65,14 +72,8 @@
creative_status_id: {
active: 1,
inactive: 2,
hidden: 3
}
- }
-
- CONSTS.merge!(
- conversion_cap_behavior: CONSTS[:conversion_behavior_id],
- conversion_behavior_on_redirect: CONSTS[:conversion_behavior_id],
- status_id: CONSTS[:offer_status_id]
- )
+ }.freeze
end
end