incontact_client 0.0.1 → 0.0.2
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/LICENSE.txt +20 -0
- data/lib/incontact_client/connection.rb +17 -1
- data/lib/incontact_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb59794b41314cf29ea18eb41052cb81bfc695a9
|
4
|
+
data.tar.gz: 42420a91b298e08ddab7cc9368e69115f547ff04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f66811b21dba8a5c200858efbb942b76cc8207f97c2d077b15bfbbd9402ed0168c86910f6c53ac438d4db50b8b7e7b61eb85803892e4a64b35d4b609dc43fb7
|
7
|
+
data.tar.gz: 56c020ddaf5bb2ca928c7eb03d733f0bad177323593ed8f8ab6e5b5294888de2cb1326441d5c56057acb84eec887ede1b554cc593b324748d0d38e899708b54a
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2017 CustomInk.com
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -99,10 +99,26 @@ module InContactClient
|
|
99
99
|
return item if item.blank? || data_model_override.is_a?(FalseClass)
|
100
100
|
|
101
101
|
# Change keys to snake case
|
102
|
-
item
|
102
|
+
item = underscore_hash_keys(item)
|
103
103
|
data_model_klass = data_model_override || default_data_model
|
104
104
|
return item if data_model_klass.nil?
|
105
105
|
data_model_klass.new(item)
|
106
106
|
end
|
107
|
+
|
108
|
+
# Based on ActiveSupport's Hash#deep_transform_keys, which is only available in
|
109
|
+
# versions >= 4.0.2. We'll port it here to work with versions < 4.0.2
|
110
|
+
# Source: https://github.com/rails/rails/blob/55f9b8129a50206513264824abb44088230793c2/activesupport/lib/active_support/core_ext/hash/keys.rb#L143-L154
|
111
|
+
def underscore_hash_keys(item)
|
112
|
+
case item
|
113
|
+
when Hash
|
114
|
+
item.each_with_object({}) do |(key, value), result|
|
115
|
+
result[key.underscore] = underscore_hash_keys(value)
|
116
|
+
end
|
117
|
+
when Array
|
118
|
+
item.map { |value| underscore_hash_keys(value) }
|
119
|
+
else
|
120
|
+
item
|
121
|
+
end
|
122
|
+
end
|
107
123
|
end
|
108
124
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incontact_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Tennity
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- ".gitignore"
|
148
148
|
- ".travis.yml"
|
149
149
|
- Gemfile
|
150
|
+
- LICENSE.txt
|
150
151
|
- README.md
|
151
152
|
- Rakefile
|
152
153
|
- docs/agent_sessions.md
|