g5_foundation_client 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 69c3727758c2c2886e78b7ac26346153c0caaaf7
4
+ data.tar.gz: 4f9871dbb191d9112f91f7d87c028bca21569ab4
5
+ SHA512:
6
+ metadata.gz: 54dff06fb1ddfd2ded90ec0aa1b13d4d14ab3be98bd9147059bb4a08e71446fc30579e7d38e5b652608a8544a85d7866d137f22d04f32e571407b1552e2d505c
7
+ data.tar.gz: 381a7bc948a68a80c3069b7cd77c0674be2c3fedf46c0df92e8a547518cafc0cc70da6245f62f42f18ca725ed59b02d2986ee56d95c8b4333490b1d1a89ac8c6
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .idea
@@ -20,9 +20,12 @@ end
20
20
  require 'g5_foundation_client/fetcher'
21
21
 
22
22
  require 'g5_foundation_client/models/findable_by_uid'
23
+ require 'g5_foundation_client/models/integration_setting'
23
24
  require 'g5_foundation_client/models/location'
24
25
  require 'g5_foundation_client/models/client'
25
26
 
26
27
  require 'g5_foundation_client/deserializers/safe_access'
28
+ require 'g5_foundation_client/deserializers/integration_setting'
27
29
  require 'g5_foundation_client/deserializers/location'
28
30
  require 'g5_foundation_client/deserializers/client'
31
+
@@ -0,0 +1,37 @@
1
+ module G5FoundationClient::Deserializers
2
+ module IntegrationSetting
3
+ extend SafeAccess
4
+
5
+ class << self
6
+ def from_hcard(hcard)
7
+ G5FoundationClient::IntegrationSetting.new(hcard_to_hash(hcard))
8
+ end
9
+
10
+ def hcard_to_hash(h)
11
+ {
12
+ inventory_service_url: with_safe_access { h.g5_inventory_service_url },
13
+ etl_strategy_name: with_safe_access { h.g5_etl_strategy_name },
14
+ vendor_endpoint: with_safe_access { h.g5_vendor_endpoint },
15
+ vendor_user_name: with_safe_access { h.g5_vendor_user_name },
16
+ vendor_password: with_safe_access { h.g5_vendor_password },
17
+ custom_integration_settings: custom_integration_settings_from_hcard(h)
18
+ }
19
+ end
20
+
21
+ def num_custom_elements(hcard)
22
+ hcard.methods.collect(&:to_s).count { |setting| setting =~ /g5_custom_integration_setting_name_\d+$/ }
23
+ end
24
+
25
+ def custom_integration_settings_from_hcard(hcard)
26
+ custom_settings = Hash.new
27
+
28
+ num_custom_elements(hcard).times do |index|
29
+ name = with_safe_access { hcard.send("g5_custom_integration_setting_name_#{index}") }
30
+ value = with_safe_access { hcard.send("g5_custom_integration_setting_value_#{index}") }
31
+ custom_settings[name.to_sym] = value
32
+ end
33
+ custom_settings
34
+ end
35
+ end
36
+ end
37
+ end
@@ -8,7 +8,7 @@ module G5FoundationClient::Deserializers
8
8
  end
9
9
 
10
10
  def self.from_hcard(hcard)
11
- G5FoundationClient::Location.new(hcard_to_hash(hcard))
11
+ G5FoundationClient::Location.new(hcard_to_hash(hcard).merge(integration_setting: IntegrationSetting.from_hcard(hcard)))
12
12
  end
13
13
 
14
14
  def self.hcard_to_hash(h)
@@ -0,0 +1,21 @@
1
+ class G5FoundationClient::IntegrationSetting
2
+ include Virtus.model
3
+
4
+ def self.deserializer_class
5
+ G5FoundationClient::Deserializers::IntegrationSetting
6
+ end
7
+
8
+ attribute :inventory_service_url, String
9
+ attribute :etl_strategy_name, String
10
+ attribute :vendor_endpoint, String
11
+ attribute :vendor_user_name, String
12
+ attribute :vendor_password, String
13
+ attribute :custom_integration_settings, Hash
14
+
15
+ def to_settings_hash
16
+ hash = self.to_h.clone
17
+ custom = hash.delete(:custom_integration_settings)
18
+ hash = hash.merge(custom) if custom
19
+ hash
20
+ end
21
+ end
@@ -6,6 +6,7 @@ class G5FoundationClient::Location
6
6
  G5FoundationClient::Deserializers::Location
7
7
  end
8
8
 
9
+ attribute :integration_setting, G5FoundationClient::IntegrationSetting
9
10
  attribute :uid, String
10
11
  attribute :urn, String
11
12
  attribute :client_uid, String
@@ -1,3 +1,3 @@
1
1
  module G5FoundationClient
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -1,17 +1,19 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head></head>
4
- <body>
5
- <article>
6
- <div class="h-card">
7
- <h2>
8
- <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client">Test Client</a>
9
- <small class="p-g5-vertical">Apartments</small> |
10
- <small class="u-g5-domain">http://example.com/</small> |
11
- <small class="p-g5-domain-type">MultiDomainClient</small>
12
- <small class="p-g5-urn">g5-c-1234-client</small>
13
- </h2>
14
- <p class="p-adr h-adr">
3
+ <head></head>
4
+ <body>
5
+ <article>
6
+ <div class="h-card">
7
+ <h2>
8
+ <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client">Test Client</a>
9
+ <small class="p-g5-vertical">Apartments</small>
10
+ |
11
+ <small class="u-g5-domain">http://example.com/</small>
12
+ |
13
+ <small class="p-g5-domain-type">MultiDomainClient</small>
14
+ <small class="p-g5-urn">g5-c-1234-client</small>
15
+ </h2>
16
+ <p class="p-adr h-adr">
15
17
  <span class="p-street-address">
16
18
  455 NW Franklin
17
19
 
@@ -21,130 +23,173 @@
21
23
  <span class="p-region">OR</span>
22
24
  <span class="p-postal-code">97701</span>
23
25
  </span>
24
- <span class="p-tel p-fax"></span>
25
- <span class="u-email"></span>
26
- </p>
27
- <div>
28
- <h4>Locations</h4>
29
- <ul class="list-unstyled">
30
- <li class="p-org h-card">
31
- <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client/locations/g5-cl-1234-location">Test Location 1</a>
32
- <a class="u-url u-g5-domain" href="http://www.salidadelsolapartments.com">http://www.salidadelsolapartments.com</a>
33
- <p class="p-adr h-adr">
26
+ <span class="p-tel p-fax"></span>
27
+ <span class="u-email"></span>
28
+ </p>
29
+
30
+ <div>
31
+ <h4>Locations</h4>
32
+ <ul class="list-unstyled">
33
+ <li class="p-org h-card">
34
+ <a class="p-name u-uid u-url"
35
+ href="http://example.com/clients/g5-c-1234-client/locations/g5-cl-1234-location">Test Location
36
+ 1</a>
37
+ <a class="u-url u-g5-domain" href="http://www.salidadelsolapartments.com">http://www.salidadelsolapartments.com</a>
38
+
39
+ <p class="p-adr h-adr">
34
40
  <span class="p-street-address">
35
41
  1125 Sunrise Blvd.
36
42
 
37
43
  </span>
38
- <span class="p-g5-neighborhood">West</span>
44
+ <span class="p-g5-neighborhood">West</span>
39
45
  <span>
40
46
  <span class="p-locality">Ventura</span>
41
47
  <span class="p-region">CA</span>
42
48
  <span class="p-postal-code">93001</span>
43
49
  </span>
44
- <span class="p-tel">805-798-1256</span>
45
- <span class="p-tel p-fax"></span>
46
- <span class="u-email">info@salidadelsolapts.com</span>
47
- </p>
48
- <p>
49
- <strong>Corporate:</strong>
50
- <br />
51
- <span class="p-g5-corporate">false</span>
52
- </p>
53
- <p>
54
- <strong>Floor Plans:</strong>
55
- <br />
56
- <span class="p-g5-floorplan">1, 2, 3, studio Apartments</span>
57
- </p>
58
- <p>
59
- <strong>Landmarks:</strong>
60
- <br />
61
- <span class="p-g5-landmark-1">Venture Marina</span>
62
- <br />
63
- <span class="p-g5-landmark-2">River Ridge Golf Course</span>
64
- </p>
65
- <p>
66
- <strong>Property Features or Qualifiers:</strong>
67
- <br />
68
- <span class="p-g5-aparment-feature-1">Luxury</span>
69
- <br />
70
- <span class="p-g5-aparment-feature-2">Gated</span>
71
- <br />
72
- <span class="p-g5-aparment-feature-3"></span>
73
- </p>
74
- <p>
75
- <strong>Primary Amenities:</strong>
76
- <br />
77
- <span class="p-g5-aparment-amenity-1">Stainless Steel Appliances</span>
78
- <br />
79
- <span class="p-g5-community-amenity-1">Fitness Center</span>
80
- </p>
81
-
82
- <h4>Client</h4>
83
- <p class="p-org h-card">
84
- <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client">Test Client</a>
85
- </p>
86
- </li>
87
- <li class="p-org h-card">
88
- <a class="p-name u-uid u-url" href="http://g5-hub.herokuapp.com/clients/g5-c-1servrzr-luxe-apartment-company/locations/g5-cl-1servrzz-depot-17">Depot 17</a>
89
- <a class="u-url u-g5-domain" href="http://www.depot17apartments.com">http://www.depot17apartments.com</a>
90
- <p class="p-adr h-adr">
50
+ <span class="p-tel">805-798-1256</span>
51
+ <span class="p-tel p-fax"></span>
52
+ <span class="u-email">info@salidadelsolapts.com</span>
53
+ </p>
54
+
55
+ <p>
56
+ <strong>Corporate:</strong>
57
+ <br/>
58
+ <span class="p-g5-corporate">false</span>
59
+ </p>
60
+
61
+ <p>
62
+ <strong>Floor Plans:</strong>
63
+ <br/>
64
+ <span class="p-g5-floorplan">1, 2, 3, studio Apartments</span>
65
+ </p>
66
+
67
+ <p>
68
+ <strong>Landmarks:</strong>
69
+ <br/>
70
+ <span class="p-g5-landmark-1">Venture Marina</span>
71
+ <br/>
72
+ <span class="p-g5-landmark-2">River Ridge Golf Course</span>
73
+ </p>
74
+
75
+ <p>
76
+ <strong>Property Features or Qualifiers:</strong>
77
+ <br/>
78
+ <span class="p-g5-aparment-feature-1">Luxury</span>
79
+ <br/>
80
+ <span class="p-g5-aparment-feature-2">Gated</span>
81
+ <br/>
82
+ <span class="p-g5-aparment-feature-3"></span>
83
+ </p>
84
+
85
+ <p>
86
+ <strong>Primary Amenities:</strong>
87
+ <br/>
88
+ <span class="p-g5-aparment-amenity-1">Stainless Steel Appliances</span>
89
+ <br/>
90
+ <span class="p-g5-community-amenity-1">Fitness Center</span>
91
+ </p>
92
+
93
+ <h4>Client</h4>
94
+
95
+ <p class="p-org h-card">
96
+ <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client">Test Client</a>
97
+ </p>
98
+ </li>
99
+ <li class="p-org h-card">
100
+ <a class="p-name u-uid u-url"
101
+ href="http://g5-hub.herokuapp.com/clients/g5-c-1servrzr-luxe-apartment-company/locations/g5-cl-1servrzz-depot-17">Depot
102
+ 17</a>
103
+ <a class="u-url u-g5-domain" href="http://www.depot17apartments.com">http://www.depot17apartments.com</a>
104
+
105
+ <p class="p-adr h-adr">
91
106
  <span class="p-street-address">
92
107
  2675 Station St.
93
108
 
94
109
  </span>
95
- <span class="p-g5-neighborhood">Park Slope</span>
110
+ <span class="p-g5-neighborhood">Park Slope</span>
96
111
  <span>
97
112
  <span class="p-locality">Brooklyn</span>
98
113
  <span class="p-region">NY</span>
99
114
  <span class="p-postal-code">11215</span>
100
115
  </span>
101
- <span class="p-tel">718-639-3915</span>
102
- <span class="p-tel p-fax"></span>
103
- <span class="u-email">info@depot17.com</span>
104
- </p>
105
- <p>
106
- <strong>Corporate:</strong>
107
- <br />
108
- <span class="p-g5-corporate">false</span>
109
- </p>
110
- <p>
111
- <strong>Floor Plans:</strong>
112
- <br />
113
- <span class="p-g5-floorplan"> Apartments</span>
114
- </p>
115
- <p>
116
- <strong>Landmarks:</strong>
117
- <br />
118
- <span class="p-g5-landmark-1"></span>
119
- <br />
120
- <span class="p-g5-landmark-2"></span>
121
- </p>
122
- <p>
123
- <strong>Property Features or Qualifiers:</strong>
124
- <br />
125
- <span class="p-g5-aparment-feature-1"></span>
126
- <br />
127
- <span class="p-g5-aparment-feature-2"></span>
128
- <br />
129
- <span class="p-g5-aparment-feature-3"></span>
130
- </p>
131
- <p>
132
- <strong>Primary Amenities:</strong>
133
- <br />
134
- <span class="p-g5-aparment-amenity-1"></span>
135
- <br />
136
- <span class="p-g5-community-amenity-1"></span>
137
- </p>
138
-
139
- <h4>Client</h4>
140
- <p class="p-org h-card">
141
- <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client">Test Client</a>
142
- </p>
143
- </li>
144
- </ul>
145
- </div>
116
+ <span class="p-tel">718-639-3915</span>
117
+ <span class="p-tel p-fax"></span>
118
+ <span class="u-email">info@depot17.com</span>
119
+ </p>
120
+
121
+ <p>
122
+ <strong>Corporate:</strong>
123
+ <br/>
124
+ <span class="p-g5-corporate">false</span>
125
+ </p>
126
+
127
+ <p>
128
+ <strong>Floor Plans:</strong>
129
+ <br/>
130
+ <span class="p-g5-floorplan"> Apartments</span>
131
+ </p>
132
+
133
+ <p>
134
+ <strong>Landmarks:</strong>
135
+ <br/>
136
+ <span class="p-g5-landmark-1"></span>
137
+ <br/>
138
+ <span class="p-g5-landmark-2"></span>
139
+ </p>
140
+
141
+ <p>
142
+ <strong>Property Features or Qualifiers:</strong>
143
+ <br/>
144
+ <span class="p-g5-aparment-feature-1"></span>
145
+ <br/>
146
+ <span class="p-g5-aparment-feature-2"></span>
147
+ <br/>
148
+ <span class="p-g5-aparment-feature-3"></span>
149
+ </p>
150
+
151
+ <p>
152
+ <strong>Primary Amenities:</strong>
153
+ <br/>
154
+ <span class="p-g5-aparment-amenity-1"></span>
155
+ <br/>
156
+ <span class="p-g5-community-amenity-1"></span>
157
+ </p>
158
+
159
+ <div>
160
+ <h4>Integration Settings</h4>
161
+ <a href="http://192.168.33.30:3000/locations/g5-cl-6hbla15-perry-hertler/integration_settings/1/edit">Edit</a>
162
+ <dl class="dl-horizontal">
163
+ <dt>Inventory Service URL</dt>
164
+ <dd class="p-g5-inventory-service-url">http://myservice.com</dd>
165
+
166
+ <dt>ETL Strategy Name</dt>
167
+ <dd class="p-g5-etl-strategy-name">centershift</dd>
168
+
169
+ <dt>Vendor Endpoint</dt>
170
+ <dd class="p-g5-vendor-endpoint">http://centershift.example.com</dd>
171
+
172
+ <dt>Vendor User Name</dt>
173
+ <dd class="p-g5-vendor-user-name">vun</dd>
174
+
175
+ <dt>Vendor Password</dt>
176
+ <dd class="p-g5-vendor-password">vpw</dd>
177
+
178
+ <dt class=p-g5-custom-integration-setting-name-0>channel</dt>
179
+ <dd class=p-g5-custom-integration-setting-value-0>6</dd>
180
+ </dl>
181
+ </div>
182
+
183
+ <h4>Client</h4>
184
+
185
+ <p class="p-org h-card">
186
+ <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client">Test Client</a>
187
+ </p>
188
+ </li>
189
+ </ul>
190
+ </div>
146
191
  </div>
147
192
 
148
- </article>
149
- </body>
193
+ </article>
194
+ </body>
150
195
  </html>
@@ -1,18 +1,20 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head></head>
4
- <body>
5
- <section class="h-card">
6
- <h2>
7
- <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client/locations/g5-cl-1234-location">Test Location</a>
3
+ <head></head>
4
+ <body>
5
+ <section class="h-card">
6
+ <h2>
7
+ <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client/locations/g5-cl-1234-location">Test
8
+ Location</a>
8
9
  <small class="p-g5-urn">g5-cl-1234-location</small>
9
- </h2>
10
+ </h2>
10
11
 
11
- <h4>Domain</h4>
12
- <a class="u-url u-g5-domain" href="http://example.com/">http://example.com/</a>
12
+ <h4>Domain</h4>
13
+ <a class="u-url u-g5-domain" href="http://example.com/">http://example.com/</a>
13
14
 
14
- <h4>Address</h4>
15
- <p class="p-adr h-adr">
15
+ <h4>Address</h4>
16
+
17
+ <p class="p-adr h-adr">
16
18
  <span class="p-street-address">
17
19
  123 Test Way
18
20
 
@@ -26,72 +28,103 @@
26
28
  <span class="p-tel">123-123-1234</span>
27
29
  <span class="p-tel p-fax"></span>
28
30
  <span class="u-email">info@salidadelsolapts.com</span>
29
- </p>
31
+ </p>
30
32
 
31
- <p>
33
+ <p>
32
34
  <strong>Corporate:</strong>
33
- <br />
35
+ <br/>
34
36
  <span class="p-g5-corporate">true</span>
35
- </p>
36
- <p>
37
+ </p>
38
+
39
+ <p>
37
40
  <strong>Hours:</strong>
38
- <br />
39
- <pre class="p-g5-hour">Mon-Fri: 7am - 6pm, Sat: 8am - 3pm, Sunday: Closed</pre>
40
- </p>
41
- <p>
41
+ <br/>
42
+ <pre class="p-g5-hour">Mon-Fri: 7am - 6pm, Sat: 8am - 3pm, Sunday: Closed</pre>
43
+ </p>
44
+ <p>
42
45
  <strong>Floor Plans:</strong>
43
- <br />
46
+ <br/>
44
47
  <span class="p-g5-floorplan">1, 2, 3, studio apartments</span>
45
- </p>
46
- <p>
48
+ </p>
49
+
50
+ <p>
47
51
  <strong>Landmarks:</strong>
48
- <br />
52
+ <br/>
49
53
  <span class="p-g5-landmark-1">Venture Marina</span>
50
- <br />
54
+ <br/>
51
55
  <span class="p-g5-landmark-2">River Ridge Golf Course</span>
52
- </p>
53
- <p>
56
+ </p>
57
+
58
+ <p>
54
59
  <strong>Property Features or Qualifiers:</strong>
55
- <br />
60
+ <br/>
56
61
  <span class="p-g5-aparment-feature-1">Luxury</span>
57
- <br />
62
+ <br/>
58
63
  <span class="p-g5-aparment-feature-2">Gated</span>
59
- <br />
64
+ <br/>
60
65
  <span class="p-g5-aparment-feature-3"></span>
61
- </p>
62
- <p>
66
+ </p>
67
+
68
+ <p>
63
69
  <strong>Primary Amenities:</strong>
64
- <br />
70
+ <br/>
65
71
  <span class="p-g5-aparment-amenity-1">Stainless Steel Appliances</span>
66
- <br />
72
+ <br/>
67
73
  <span class="p-g5-community-amenity-1">Fitness Center</span>
68
- </p>
74
+ </p>
69
75
 
70
- <h4>Google Analytics</h4>
71
- <dl class="dl-horizontal">
76
+ <h4>Google Analytics</h4>
77
+ <dl class="dl-horizontal">
72
78
  <dt>Tracking ID</dt>
73
79
  <dd class="p-ga-tracking-id">UA-1234-1</dd>
74
80
 
75
81
  <dt>View Profile ID</dt>
76
82
  <dd class="p-ga-profile-id">ga:1234</dd>
77
- </dl>
78
-
79
- <dl>
80
- <dt>Twitter</dt>
81
- <dd class="p-nickname p-g5-nickname-twitter">G5Platform</dd>
82
- <dt>Facebook</dt>
83
- <dd class="p-nickname p-g5-nickname-facebook">GetG5</dd>
84
- <dt>Yelp</dt>
85
- <dd class="p-nickname p-g5-nickname-yelp">g5-bend</dd>
86
- <dt>Foursquare</dt>
87
- <dd class="p-nickname p-g5-nickname-foursquare">https://foursquare.com/v/g5-search-marketing/4b720385f964a5201b6a2de3</dd>
88
- </dl>
89
-
90
- <h4>Client</h4>
91
- <p class="p-org h-card">
83
+ </dl>
84
+
85
+ <div>
86
+ <h4>Integration Settings</h4>
87
+ <a href="http://192.168.33.30:3000/locations/g5-cl-6hbla15-perry-hertler/integration_settings/1/edit">Edit</a>
88
+ <dl class="dl-horizontal">
89
+ <dt>Inventory Service URL</dt>
90
+ <dd class="p-g5-inventory-service-url">http://myservice.com</dd>
91
+
92
+ <dt>ETL Strategy Name</dt>
93
+ <dd class="p-g5-etl-strategy-name">centershift</dd>
94
+
95
+ <dt>Vendor Endpoint</dt>
96
+ <dd class="p-g5-vendor-endpoint">http://centershift.example.com</dd>
97
+
98
+ <dt>Vendor User Name</dt>
99
+ <dd class="p-g5-vendor-user-name">vun</dd>
100
+
101
+ <dt>Vendor Password</dt>
102
+ <dd class="p-g5-vendor-password">vpw</dd>
103
+
104
+ <dt class=p-g5-custom-integration-setting-name-0>channel</dt>
105
+ <dd class=p-g5-custom-integration-setting-value-0>6</dd>
106
+ </dl>
107
+ </div>
108
+
109
+ <dl>
110
+ <dt>Twitter</dt>
111
+ <dd class="p-nickname p-g5-nickname-twitter">G5Platform</dd>
112
+ <dt>Facebook</dt>
113
+ <dd class="p-nickname p-g5-nickname-facebook">GetG5</dd>
114
+ <dt>Yelp</dt>
115
+ <dd class="p-nickname p-g5-nickname-yelp">g5-bend</dd>
116
+ <dt>Foursquare</dt>
117
+ <dd class="p-nickname p-g5-nickname-foursquare">
118
+ https://foursquare.com/v/g5-search-marketing/4b720385f964a5201b6a2de3
119
+ </dd>
120
+ </dl>
121
+
122
+ <h4>Client</h4>
123
+
124
+ <p class="p-org h-card">
92
125
  <a class="p-name u-uid u-url" href="http://example.com/clients/g5-c-1234-client">Test Client</a>
93
- </p>
94
- </section>
126
+ </p>
127
+ </section>
95
128
 
96
- </body>
129
+ </body>
97
130
  </html>
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe G5FoundationClient::Deserializers::IntegrationSetting do
4
+ describe '.from_markup' do
5
+ subject { G5FoundationClient::Deserializers::Location.from_markup(markup).integration_setting }
6
+
7
+ context 'with many fields provided' do
8
+ let(:markup) { fixture('location_detail.html') }
9
+
10
+ its(:inventory_service_url) { should eq('http://myservice.com') }
11
+ its(:etl_strategy_name) { should eq('centershift') }
12
+ its(:vendor_endpoint) { should eq('http://centershift.example.com') }
13
+ its(:vendor_user_name) { should eq('vun') }
14
+ its(:vendor_password) { should eq('vpw') }
15
+ its(:custom_integration_settings) { should eq({channel: '6'}) }
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ describe G5FoundationClient::IntegrationSetting do
4
+ before { G5FoundationClient.access_token = 'token' }
5
+
6
+ describe 'instantiating with a hash' do
7
+ let(:inventory_service_url) { 'http://inventory.service.example.com' }
8
+ let(:etl_strategy_name) { 'Centershift' }
9
+ let(:vendor_endpoint) { 'http://centershift.example.com' }
10
+ let(:vendor_user_name) { 'uname' }
11
+ let(:vendor_password) { 'pw' }
12
+ let(:custom_integration_settings) { {foo: 'bar'} }
13
+ let(:init_hash) { {inventory_service_url: inventory_service_url,
14
+ etl_strategy_name: etl_strategy_name,
15
+ vendor_endpoint: vendor_endpoint,
16
+ vendor_user_name: vendor_user_name,
17
+ vendor_password: vendor_password,
18
+ custom_integration_settings: custom_integration_settings} }
19
+ let(:expected_to_settings_hash) do
20
+ expected = init_hash.clone
21
+ custom = expected.delete(:custom_integration_settings)
22
+ expected.merge(custom)
23
+ end
24
+ subject { G5FoundationClient::IntegrationSetting.new(init_hash) }
25
+
26
+ its(:inventory_service_url) { should eql(inventory_service_url) }
27
+ its(:etl_strategy_name) { should eql(etl_strategy_name) }
28
+ its(:vendor_endpoint) { should eql(vendor_endpoint) }
29
+ its(:vendor_user_name) { should eql(vendor_user_name) }
30
+ its(:vendor_password) { should eql(vendor_password) }
31
+ its(:custom_integration_settings) { should eql(custom_integration_settings) }
32
+ its(:to_settings_hash) { should eq(expected_to_settings_hash) }
33
+ end
34
+ end
metadata CHANGED
@@ -1,158 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_foundation_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Don Petersen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-07-11 00:00:00.000000000 Z
11
+ date: 2014-09-16 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: virtus
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: httparty
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: microformats2
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: g5_authentication_client
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0.2'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0.2'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: bundler
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - "~>"
84
74
  - !ruby/object:Gem::Version
85
75
  version: '1.5'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - "~>"
92
81
  - !ruby/object:Gem::Version
93
82
  version: '1.5'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rake
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rspec
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - <
101
+ - - "<"
116
102
  - !ruby/object:Gem::Version
117
103
  version: '2.99'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - <
108
+ - - "<"
124
109
  - !ruby/object:Gem::Version
125
110
  version: '2.99'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: webmock
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - ">="
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - ">="
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: pry
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ! '>='
129
+ - - ">="
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ! '>='
136
+ - - ">="
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  description: Client gem to interact with G5 services.
@@ -162,9 +143,9 @@ executables: []
162
143
  extensions: []
163
144
  extra_rdoc_files: []
164
145
  files:
165
- - .gitignore
166
- - .rspec
167
- - .travis.yml
146
+ - ".gitignore"
147
+ - ".rspec"
148
+ - ".travis.yml"
168
149
  - Gemfile
169
150
  - LICENSE.txt
170
151
  - README.md
@@ -172,11 +153,13 @@ files:
172
153
  - g5_foundation_client.gemspec
173
154
  - lib/g5_foundation_client.rb
174
155
  - lib/g5_foundation_client/deserializers/client.rb
156
+ - lib/g5_foundation_client/deserializers/integration_setting.rb
175
157
  - lib/g5_foundation_client/deserializers/location.rb
176
158
  - lib/g5_foundation_client/deserializers/safe_access.rb
177
159
  - lib/g5_foundation_client/fetcher.rb
178
160
  - lib/g5_foundation_client/models/client.rb
179
161
  - lib/g5_foundation_client/models/findable_by_uid.rb
162
+ - lib/g5_foundation_client/models/integration_setting.rb
180
163
  - lib/g5_foundation_client/models/location.rb
181
164
  - lib/g5_foundation_client/record_not_found_exception.rb
182
165
  - lib/g5_foundation_client/rspec.rb
@@ -186,45 +169,48 @@ files:
186
169
  - spec/fixtures/empty_hcard.html
187
170
  - spec/fixtures/location_detail.html
188
171
  - spec/lib/g5_foundation_client/deserializers/client_spec.rb
172
+ - spec/lib/g5_foundation_client/deserializers/integration_setting_spec.rb
189
173
  - spec/lib/g5_foundation_client/deserializers/location_spec.rb
190
174
  - spec/lib/g5_foundation_client/fetcher_spec.rb
191
175
  - spec/lib/g5_foundation_client/models/client_spec.rb
176
+ - spec/lib/g5_foundation_client/models/integration_setting_spec.rb
192
177
  - spec/lib/g5_foundation_client/models/location_spec.rb
193
178
  - spec/lib/g5_foundation_client_spec.rb
194
179
  - spec/spec_helper.rb
195
180
  homepage: https://github.com/g5/g5_foundation_client
196
181
  licenses:
197
182
  - MIT
183
+ metadata: {}
198
184
  post_install_message:
199
185
  rdoc_options: []
200
186
  require_paths:
201
187
  - lib
202
188
  required_ruby_version: !ruby/object:Gem::Requirement
203
- none: false
204
189
  requirements:
205
- - - ! '>='
190
+ - - ">="
206
191
  - !ruby/object:Gem::Version
207
192
  version: '0'
208
193
  required_rubygems_version: !ruby/object:Gem::Requirement
209
- none: false
210
194
  requirements:
211
- - - ! '>='
195
+ - - ">="
212
196
  - !ruby/object:Gem::Version
213
197
  version: '0'
214
198
  requirements: []
215
199
  rubyforge_project:
216
- rubygems_version: 1.8.23
200
+ rubygems_version: 2.2.0
217
201
  signing_key:
218
- specification_version: 3
202
+ specification_version: 4
219
203
  summary: Client gem to interact with G5 services.
220
204
  test_files:
221
205
  - spec/fixtures/client_detail.html
222
206
  - spec/fixtures/empty_hcard.html
223
207
  - spec/fixtures/location_detail.html
224
208
  - spec/lib/g5_foundation_client/deserializers/client_spec.rb
209
+ - spec/lib/g5_foundation_client/deserializers/integration_setting_spec.rb
225
210
  - spec/lib/g5_foundation_client/deserializers/location_spec.rb
226
211
  - spec/lib/g5_foundation_client/fetcher_spec.rb
227
212
  - spec/lib/g5_foundation_client/models/client_spec.rb
213
+ - spec/lib/g5_foundation_client/models/integration_setting_spec.rb
228
214
  - spec/lib/g5_foundation_client/models/location_spec.rb
229
215
  - spec/lib/g5_foundation_client_spec.rb
230
216
  - spec/spec_helper.rb