tokyo_api 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tokyo_api/identity.rb +3 -9
- data/spec/identity_spec.rb +2 -8
- data/tokyo_api.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdd1545cc1b4afe1f6eafc3340d94c7ddb37c0cd90e7fe503141379bb9376e53
|
4
|
+
data.tar.gz: a9fdad05531bea8f72116ae4acfecf1e63ce175bb746ee174f14dae41f4c8053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af6a4d89de242ddea6be9ea408d8294467cd6188421a777f489032b3b35fdb872e220ba4b319695895fc8a93b3519cf910d2891d17f8e3310e9674d61f5642c1
|
7
|
+
data.tar.gz: ae88b3862d4cd5e703f7dcb87c6e2f9a2b9fb96cb7697441a1596fd307054d1ee9439110ffb8792abaab9ad2bf726a182547306a506ad144807cc66c2e34c7c6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/lib/tokyo_api/identity.rb
CHANGED
@@ -17,16 +17,10 @@ module TokyoApi
|
|
17
17
|
path
|
18
18
|
end
|
19
19
|
|
20
|
-
def subscription_status_path(id,
|
21
|
-
|
22
|
-
raise 'must provide either opt_in_public_ids or opt_in_external_id'
|
23
|
-
end
|
20
|
+
def subscription_status_path(id, opt_in_public_ids: nil, minimum_consent_level: nil)
|
21
|
+
raise 'must provide opt_in_public_ids' if opt_in_public_ids.nil?
|
24
22
|
|
25
|
-
|
26
|
-
path = "/#{normalized_base_path}subscription_status/#{url_escape(id)}?opt_in_external_id=#{url_escape(opt_in_external_id)}"
|
27
|
-
else
|
28
|
-
path = "/#{normalized_base_path}subscription_status/#{url_escape(id)}?opt_in_public_ids=#{url_escape(opt_in_public_ids.join(','))}"
|
29
|
-
end
|
23
|
+
path = "/#{normalized_base_path}subscription_status/#{url_escape(id)}?opt_in_public_ids=#{url_escape(opt_in_public_ids.join(','))}"
|
30
24
|
|
31
25
|
if minimum_consent_level
|
32
26
|
path = "#{path}&minimum_consent_level=#{url_escape(minimum_consent_level)}"
|
data/spec/identity_spec.rb
CHANGED
@@ -65,15 +65,9 @@ describe TokyoApi::Identity do
|
|
65
65
|
expect(subject.identity.subscription_status_path('abc123', opt_in_public_ids: ['policy-1.5', 'policy-1.6'])).to eq expected_path
|
66
66
|
end
|
67
67
|
|
68
|
-
|
69
|
-
it 'should return correct path for a specific external id' do
|
70
|
-
expected_path = '/identity/subscription_status/abc123?opt_in_external_id=policy-1.5'
|
71
|
-
expect(subject.identity.subscription_status_path('abc123', opt_in_external_id: 'policy-1.5')).to eq expected_path
|
72
|
-
end
|
73
|
-
|
74
68
|
it 'should support minimum_consent_level' do
|
75
|
-
expected_path = '/identity/subscription_status/abc123?
|
76
|
-
expect(subject.identity.subscription_status_path('abc123',
|
69
|
+
expected_path = '/identity/subscription_status/abc123?opt_in_public_ids=policy-1.5&minimum_consent_level=explicit'
|
70
|
+
expect(subject.identity.subscription_status_path('abc123', opt_in_public_ids: ['policy-1.5'], minimum_consent_level: 'explicit')).to eq expected_path
|
77
71
|
end
|
78
72
|
end
|
79
73
|
end
|
data/tokyo_api.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: tokyo_api 1.0
|
5
|
+
# stub: tokyo_api 1.1.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "tokyo_api".freeze
|
9
|
-
s.version = "1.0
|
9
|
+
s.version = "1.1.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Nathan Woodhull".freeze]
|
14
|
-
s.date = "2018-05-
|
14
|
+
s.date = "2018-05-14"
|
15
15
|
s.description = "Tokyo is a CRM middleware, this gem helps apps talk to it.".freeze
|
16
16
|
s.email = "nathan@controlshiftlabs.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tokyo_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Woodhull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vertebrae
|