g5_foundation_client 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/g5_foundation_client/models/client.rb +1 -1
- data/lib/g5_foundation_client/models/integration_setting.rb +2 -2
- data/lib/g5_foundation_client/models/location.rb +2 -2
- data/lib/g5_foundation_client/version.rb +1 -1
- data/spec/lib/g5_foundation_client/models/integration_setting_spec.rb +10 -1
- data/spec/lib/g5_foundation_client/models/location_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7841d2bcd3b4e14c5035c4053362b22edd64c6
|
4
|
+
data.tar.gz: 0b9be7e3a0bc7ee77c5bdc3fd175b9e3a1d1a72a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16afaabefebb99cbfe77b0acbb94445d2c8d03b59649b2a4de8f11dc0dd3b2d173c684c2dc8bac70643c49116c7904b35053b6748402c56228b3988ee3d6cdc9
|
7
|
+
data.tar.gz: a4261abb9bb26f64f3871f5842f890a8f74f22c5d53bd46312169c4e0c93831ece4078a80255d8546a9c3a6cb2a9f39fdb3c954c9342fa97755bdd6dd37cf04c
|
@@ -3,7 +3,7 @@ class G5FoundationClient::Client
|
|
3
3
|
attr_accessor :client_hash
|
4
4
|
|
5
5
|
def initialize(attrs)
|
6
|
-
self.client_hash = attrs.fetch(:client, attrs)
|
6
|
+
self.client_hash = ActiveSupport::HashWithIndifferentAccess.new attrs.fetch(:client, attrs)
|
7
7
|
end
|
8
8
|
|
9
9
|
[:id, :uid, :name, :urn, :vertical, :street_address_1, :street_address_2,
|
@@ -3,8 +3,8 @@ class G5FoundationClient::IntegrationSetting
|
|
3
3
|
attr_accessor :location
|
4
4
|
|
5
5
|
def initialize(attrs)
|
6
|
-
self.
|
7
|
-
self.
|
6
|
+
self.location = attrs.delete(:location) || attrs.delete('location')
|
7
|
+
self.integration_setting_hash = ActiveSupport::HashWithIndifferentAccess.new attrs
|
8
8
|
end
|
9
9
|
|
10
10
|
def to_settings_hash
|
@@ -4,8 +4,8 @@ class G5FoundationClient::Location
|
|
4
4
|
attr_accessor :location_hash, :client
|
5
5
|
|
6
6
|
def initialize(attrs)
|
7
|
-
self.
|
8
|
-
self.
|
7
|
+
self.client = attrs.delete(:client) || attrs.delete('client')
|
8
|
+
self.location_hash = ActiveSupport::HashWithIndifferentAccess.new attrs.fetch(:location, attrs)
|
9
9
|
end
|
10
10
|
|
11
11
|
[:id, :uid, :client_uid, :client_id, :name, :corporate, :created_at, :updated_at, :urn,
|
@@ -29,6 +29,15 @@ describe G5FoundationClient::IntegrationSetting do
|
|
29
29
|
urn: urn
|
30
30
|
} }
|
31
31
|
|
32
|
+
let(:expected_hash) do
|
33
|
+
hash = init_hash.dup
|
34
|
+
hash.delete(:location)
|
35
|
+
hash.keys.each do |key|
|
36
|
+
hash[key.to_s] = hash.delete(key)
|
37
|
+
end
|
38
|
+
hash
|
39
|
+
end
|
40
|
+
|
32
41
|
subject { G5FoundationClient::IntegrationSetting.new(init_hash) }
|
33
42
|
|
34
43
|
its(:job_frequency_in_minutes) { should eql(job_frequency_in_minutes) }
|
@@ -41,7 +50,7 @@ describe G5FoundationClient::IntegrationSetting do
|
|
41
50
|
its(:vendor_user_name) { should eql(vendor_user_name) }
|
42
51
|
its(:vendor_password) { should eql(vendor_password) }
|
43
52
|
its(:strategy_name) { should eql(strategy_name) }
|
44
|
-
its(:to_settings_hash) { should eq(
|
53
|
+
its(:to_settings_hash) { should eq(expected_hash) }
|
45
54
|
its(:inventory?) { should be_true }
|
46
55
|
its(:lead?) { should be_false }
|
47
56
|
end
|