vwo-sdk 1.14.0 → 1.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vwo.rb +8 -14
  3. data/lib/vwo/constants.rb +1 -1
  4. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53bc0be49f50d280aac4478d6879a31dce269ed69596e5ff2d04b51cbcacbcbd
4
- data.tar.gz: f28c84dc2ace873bf1c5fd748568d06c16583b466240df54fcf9dbd5dffec888
3
+ metadata.gz: b54dc7f86b437e994c1aec92ceae2afbb5f0045deeefb2ed7feb791094e025fd
4
+ data.tar.gz: 4d087003e85fbccc63af443c7ba7e7068079df27e151e48df5f52952cd14e680
5
5
  SHA512:
6
- metadata.gz: 63bf38a8c25c69e01cf7cbfdad204379c0dd03621e947c1848a1fdf24b432bd26672a8d3cb9efded0e45582208a73a0c69142911c900e53e477e06b2d06a069e
7
- data.tar.gz: 0b9d9165ca2ae918a048537097f2de775fe13d35547c341aa45c7edc42206273775f18120c10ca06fc02821c24652bd25e513a05989889664285210b6fd57f02
6
+ metadata.gz: 85f28097bbc3a311354e0702f27738dc9381d37e67beba61dd7978babf81b626e1a0ccee83b503fd5e5c4fe03235cde8fd875d0643fa4e50356bc8bfd101be8c
7
+ data.tar.gz: 26c18b27e473970f0dd3ad2bf27fd4ff7e81c0aac6ee4eb84decd4f5a21db74e02082d34eb1dc74106890dd353d430bec7c77a3b90fd7fb09b9e92056072e719
data/lib/vwo.rb CHANGED
@@ -563,10 +563,11 @@ class VWO
563
563
  # @param[String] :campaign_key Unique campaign key
564
564
  # @param[String] :user_id ID assigned to a user
565
565
  # @param[String] :goal_identifier Unique campaign's goal identifier
566
- # @param[Array|Hash] :args Contains revenue value and custom variables
566
+ # @param[Hash] :options Contains revenue value and custom variables
567
567
  # @param[Numeric|String] :revenue_value It is the revenue generated on triggering the goal
568
568
  #
569
- def track(campaign_key, user_id, goal_identifier, *args)
569
+
570
+ def track(campaign_key, user_id, goal_identifier, options = {})
570
571
  unless @is_instance_valid
571
572
  @logger.log(
572
573
  LogLevelEnum::ERROR,
@@ -579,18 +580,11 @@ class VWO
579
580
  return false
580
581
  end
581
582
 
582
- if args[0].is_a?(Hash)
583
- revenue_value = args[0]['revenue_value'] || args[0][:revenue_value]
584
- custom_variables = args[0]['custom_variables'] || args[0][:custom_variables]
585
- variation_targeting_variables = args[0]['variation_targeting_variables'] || args[0][:variation_targeting_variables]
586
- should_track_returning_user = get_should_track_returning_user(args[0])
587
- goal_type_to_track = get_goal_type_to_track(args[0])
588
- elsif args.is_a?(Array)
589
- revenue_value = args[0]
590
- custom_variables = nil
591
- should_track_returning_user = @should_track_returning_user
592
- goal_type_to_track = @goal_type_to_track
593
- end
583
+ revenue_value = options['revenue_value'] || options[:revenue_value]
584
+ custom_variables = options['custom_variables'] || options[:custom_variables]
585
+ variation_targeting_variables = options['variation_targeting_variables'] || options[:variation_targeting_variables]
586
+ should_track_returning_user = get_should_track_returning_user(options)
587
+ goal_type_to_track = get_goal_type_to_track(options)
594
588
 
595
589
  # Check for valid args
596
590
  unless (valid_string?(campaign_key) || campaign_key.is_a?(Array) || campaign_key.nil?) && valid_string?(user_id) && valid_string?(goal_identifier) && (custom_variables.nil? || valid_hash?(custom_variables)) &&
data/lib/vwo/constants.rb CHANGED
@@ -26,7 +26,7 @@ class VWO
26
26
  HTTP_PROTOCOL = 'http://'
27
27
  HTTPS_PROTOCOL = 'https://'
28
28
  URL_NAMESPACE = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'
29
- SDK_VERSION = '1.14.0'
29
+ SDK_VERSION = '1.14.1'
30
30
  SDK_NAME = 'ruby'
31
31
  VWO_DELIMITER = '_vwo_'
32
32
  MAX_EVENTS_PER_REQUEST = 5000
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vwo-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - VWO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-07 00:00:00.000000000 Z
11
+ date: 2021-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.70'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mocha
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.13.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.13.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: json-schema
43
57
  requirement: !ruby/object:Gem::Requirement