chartmogul-ruby 1.6.6 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/changelog.md +3 -0
- data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_custom_attributes.yml +2 -2
- data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml +2 -2
- data/lib/chartmogul/api/actions/create.rb +2 -2
- data/lib/chartmogul/api/actions/custom.rb +1 -1
- data/lib/chartmogul/api/actions/retrieve.rb +1 -1
- data/lib/chartmogul/api/actions/update.rb +3 -2
- data/lib/chartmogul/api_resource.rb +6 -1
- data/lib/chartmogul/customer.rb +1 -0
- data/lib/chartmogul/utils/json_parser.rb +3 -1
- data/lib/chartmogul/version.rb +1 -1
- 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: 7217ec585904be468d9fc18d74c84a783803ca3d0bcf5e3e2f6f916012131a4f
|
4
|
+
data.tar.gz: d28cf68e49a9f7da6bb39cb2d1cb1fa49c93d9337296d87e1f96a9aa1b5daecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e1a312266b32b8a50309c92999f09047ad64f3de5539f7c468dd1b2d29ca47469322ef38ab1bcd19bd16c8aad175a018f0886129b1b64a2b2275ccfee79ca8
|
7
|
+
data.tar.gz: 66d4079794ddddba66de3236217fc432ccaeba90f338789e2d158d23c23e687f5cbd05f111498b977becde0497ade73d97a9659244bfc29ded921342fc27065e
|
data/changelog.md
CHANGED
@@ -44,7 +44,7 @@ http_interactions:
|
|
44
44
|
uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047/attributes/custom
|
45
45
|
body:
|
46
46
|
encoding: UTF-8
|
47
|
-
string: '{"custom":[{"type":"String","key":"
|
47
|
+
string: '{"custom":[{"type":"String","key":"StringKey","value":"String Value"},{"type":"Integer","key":"integer_key","value":1234},{"type":"Timestamp","key":"timestamp_key","value":"2016-01-31
|
48
48
|
00:00:00 UTC"},{"type":"Boolean","key":"boolean_key","value":true}]}'
|
49
49
|
headers:
|
50
50
|
User-Agent:
|
@@ -74,7 +74,7 @@ http_interactions:
|
|
74
74
|
- 'true'
|
75
75
|
body:
|
76
76
|
encoding: UTF-8
|
77
|
-
string: '{"custom":{"
|
77
|
+
string: '{"custom":{"StringKey":"String Value","integer_key":1234,"timestamp_key":"2016-01-31T00:00:00.000Z","boolean_key":true}}'
|
78
78
|
http_version:
|
79
79
|
recorded_at: Wed, 29 Jun 2016 12:47:09 GMT
|
80
80
|
recorded_with: VCR 3.0.3
|
data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml
CHANGED
@@ -45,7 +45,7 @@ http_interactions:
|
|
45
45
|
uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047/attributes/custom
|
46
46
|
body:
|
47
47
|
encoding: UTF-8
|
48
|
-
string: '{"custom":{"
|
48
|
+
string: '{"custom":{"StringKey":"Another String Value","integer_key":5678,"timestamp_key":"2016-02-01
|
49
49
|
00:00:00 UTC","boolean_key":false}}'
|
50
50
|
headers:
|
51
51
|
User-Agent:
|
@@ -75,7 +75,7 @@ http_interactions:
|
|
75
75
|
- 'true'
|
76
76
|
body:
|
77
77
|
encoding: UTF-8
|
78
|
-
string: '{"custom":{"
|
78
|
+
string: '{"custom":{"StringKey":"Another String Value","integer_key":5678,"timestamp_key":"2016-02-01T00:00:00.000Z","boolean_key":false}}'
|
79
79
|
http_version:
|
80
80
|
recorded_at: Wed, 29 Jun 2016 12:47:09 GMT
|
81
81
|
recorded_with: VCR 3.0.3
|
@@ -15,7 +15,7 @@ module ChartMogul
|
|
15
15
|
req.body = JSON.dump(serialize_for_write)
|
16
16
|
end
|
17
17
|
end
|
18
|
-
json = ChartMogul::Utils::JSONParser.parse(resp.body)
|
18
|
+
json = ChartMogul::Utils::JSONParser.parse(resp.body, skip_case_conversion: self.class.skip_case_conversion)
|
19
19
|
|
20
20
|
assign_all_attributes(json)
|
21
21
|
end
|
@@ -30,7 +30,7 @@ module ChartMogul
|
|
30
30
|
req.body = JSON.dump(resource.serialize_for_write)
|
31
31
|
end
|
32
32
|
end
|
33
|
-
json = ChartMogul::Utils::JSONParser.parse(resp.body)
|
33
|
+
json = ChartMogul::Utils::JSONParser.parse(resp.body, skip_case_conversion: skip_case_conversion)
|
34
34
|
|
35
35
|
new_from_json(json)
|
36
36
|
end
|
@@ -25,7 +25,7 @@ module ChartMogul
|
|
25
25
|
req.body = JSON.dump(body_data)
|
26
26
|
end
|
27
27
|
end
|
28
|
-
ChartMogul::Utils::JSONParser.parse(resp.body)
|
28
|
+
ChartMogul::Utils::JSONParser.parse(resp.body, skip_case_conversion: skip_case_conversion)
|
29
29
|
end
|
30
30
|
|
31
31
|
def custom!(http_method, http_path, body_data = {})
|
@@ -15,7 +15,7 @@ module ChartMogul
|
|
15
15
|
req.headers['Content-Type'] = 'application/json'
|
16
16
|
end
|
17
17
|
end
|
18
|
-
json = ChartMogul::Utils::JSONParser.parse(resp.body)
|
18
|
+
json = ChartMogul::Utils::JSONParser.parse(resp.body, skip_case_conversion: skip_case_conversion)
|
19
19
|
new_from_json(json)
|
20
20
|
end
|
21
21
|
end
|
@@ -15,7 +15,8 @@ module ChartMogul
|
|
15
15
|
req.body = JSON.dump(serialize_for_write)
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
|
+
json = ChartMogul::Utils::JSONParser.parse(resp.body, skip_case_conversion: self.class.skip_case_conversion)
|
19
20
|
|
20
21
|
assign_all_attributes(json)
|
21
22
|
end
|
@@ -30,7 +31,7 @@ module ChartMogul
|
|
30
31
|
req.body = JSON.dump(resource.serialize_for_write)
|
31
32
|
end
|
32
33
|
end
|
33
|
-
json = ChartMogul::Utils::JSONParser.parse(resp.body)
|
34
|
+
json = ChartMogul::Utils::JSONParser.parse(resp.body, skip_case_conversion: skip_case_conversion)
|
34
35
|
|
35
36
|
new_from_json(json)
|
36
37
|
end
|
@@ -17,7 +17,7 @@ module ChartMogul
|
|
17
17
|
MAX_INTERVAL = 60
|
18
18
|
THREAD_CONNECTION_KEY = 'chartmogul_ruby.api_resource.connection'
|
19
19
|
|
20
|
-
class << self; attr_reader :resource_path, :resource_name, :resource_root_key end
|
20
|
+
class << self; attr_reader :resource_path, :resource_name, :resource_root_key, :skip_case_conversion end
|
21
21
|
|
22
22
|
def self.set_resource_path(path)
|
23
23
|
@resource_path = ChartMogul::ResourcePath.new(path)
|
@@ -31,6 +31,11 @@ module ChartMogul
|
|
31
31
|
@resource_root_key = root_key
|
32
32
|
end
|
33
33
|
|
34
|
+
# When true, response hash keys won't be converted to snake case
|
35
|
+
def self.set_skip_case_conversion(value)
|
36
|
+
@skip_case_conversion = value
|
37
|
+
end
|
38
|
+
|
34
39
|
def self.connection
|
35
40
|
Thread.current[THREAD_CONNECTION_KEY] ||= build_connection
|
36
41
|
end
|
data/lib/chartmogul/customer.rb
CHANGED
@@ -4,8 +4,10 @@ module ChartMogul
|
|
4
4
|
module Utils
|
5
5
|
class JSONParser
|
6
6
|
class << self
|
7
|
-
def parse(json_string)
|
7
|
+
def parse(json_string, skip_case_conversion: false)
|
8
8
|
hash = JSON.parse(json_string, symbolize_names: true)
|
9
|
+
return hash if skip_case_conversion
|
10
|
+
|
9
11
|
HashSnakeCaser.new(hash).to_snake_keys
|
10
12
|
end
|
11
13
|
|
data/lib/chartmogul/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chartmogul-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Kopac
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|