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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebde6eea4a7c71b04b7f0b37b92257d84b11f3c5
4
- data.tar.gz: e8862eb75387f21338f8a3912f6f62400076b978
3
+ metadata.gz: 0e7841d2bcd3b4e14c5035c4053362b22edd64c6
4
+ data.tar.gz: 0b9be7e3a0bc7ee77c5bdc3fd175b9e3a1d1a72a
5
5
  SHA512:
6
- metadata.gz: cfa222ead4d630fea53d07582a45b945ce9eee0e5b4ba94e0ce1e064186c6f1b6ba750be12276565b78e2c7608833ff4d7b314708e062cd840544da5a7c6cce9
7
- data.tar.gz: 9284c7effa77f1b73ec9ec434b619f8c890ecdf1db3aabef2516cbc6d4327e57921057c1a2b03c9ceba867b1c5d1e8712e4bdea325e2e14cb8eb106870c7da75
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.integration_setting_hash = attrs
7
- self.location = self.integration_setting_hash.delete(:location)
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.location_hash = attrs.fetch(:location, attrs)
8
- self.client = self.location_hash.delete(:client)
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,
@@ -1,3 +1,3 @@
1
1
  module G5FoundationClient
2
- VERSION = '0.0.14'
2
+ VERSION = '0.0.15'
3
3
  end
@@ -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(init_hash) }
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
@@ -9,6 +9,7 @@ describe G5FoundationClient::Location do
9
9
  G5FoundationClient::Location.new(
10
10
  uid: "http://example.com/urn",
11
11
  urn: "urn",
12
+ client: client,
12
13
  client_uid: "http://example.com/client_uid",
13
14
  name: "Test Name",
14
15
  phone_number: "123-123-1234",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_foundation_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Petersen