promoter 0.2.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9333711f05054354742338ee9ac3bbc11cf8084c00704a3eabdc8798101ce14
4
- data.tar.gz: bd2a3247c8ef872f1a7d988c6230e28ca0a0d998f9bb96bbcaf152764d1455ac
3
+ metadata.gz: 34ba1543f397687aaf890f45ee5c8f1fddce0cfc78208dd452c5aecea7f20315
4
+ data.tar.gz: 1c804776dca6b580ab6cd9f99bf1e0f5ed3aa279706fc82032f75d43af1e0a31
5
5
  SHA512:
6
- metadata.gz: 713c0eb3148eda34d126594cdf2b98e7b8d35fa2148893269a6cf90d1f102d79a2cb02a0f520c33170459ef444f234d88ac06e45b734877725b3af87447452f1
7
- data.tar.gz: 8c0629627da499b1610a0d896926b7c8cc6b3a1e823c8f00442b04fa3a9d8444739652215f7d6117aa80ad12c8c55544e4a1366118619ddace1f0c3c97a2481a
6
+ metadata.gz: e503a96456e5b28f1a131308d00f47c598c2d37cb1329bd09eaf76507254bd228220c223a2cd2754b6e85c3f6ebc108e7dbd89ab4ed3f48d7af5cebb69711cc4
7
+ data.tar.gz: c9e0773d845101987e0eab4b0662c1760f01d590906a2b3e01841978ea82a99f84d453c3c244e9ccab3d4d0e49bede91ed5ab715426cd1e2f12310fbb30c6d9a
data/.gitignore CHANGED
@@ -8,4 +8,5 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
- *.gem
11
+ *.gem
12
+ .byebug_history
@@ -12,5 +12,6 @@ module Promoter
12
12
  class << self
13
13
  attr_accessor :api_key
14
14
  attr_accessor :debug
15
+ attr_accessor :api_version
15
16
  end
16
17
  end
@@ -86,8 +86,14 @@ module Promoter
86
86
  end
87
87
 
88
88
  def self.survey(params)
89
- response = Request.post(API_URL + "/survey/", params)
90
- new(response)
89
+ contact_attributes = if Promoter.api_version == 2
90
+ api_url = "https://app.promoter.io/api/v2"
91
+ response = Request.post(api_url + "/survey/", params)
92
+ response["contact"]
93
+ else
94
+ Request.post(API_URL + "/survey/", params)
95
+ end
96
+ new(contact_attributes)
91
97
  end
92
98
 
93
99
  # used for ensuring the values of the attributes hashes are strings
@@ -1,3 +1,3 @@
1
1
  module Promoter
2
- VERSION = "0.2.0"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency "rspec"
25
25
  spec.add_development_dependency "webmock"
26
+ spec.add_development_dependency "byebug"
26
27
 
27
28
  spec.add_dependency "httparty"
28
29
  spec.add_dependency "json"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promoter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris O'Sullivan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2019-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: httparty
71
85
  requirement: !ruby/object:Gem::Requirement