g5_foundation_client 0.0.9 → 0.0.11

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: f8e214f0f67d36fd31d92bb83d32e0e1933af173
4
- data.tar.gz: 172efea40e91283f48b3ee5a8fee665aca96b515
3
+ metadata.gz: 8aee7ab51c48a451cbd70077ccb71498c7cc5a58
4
+ data.tar.gz: 93d62006584c1182df61bf629b1917306380770e
5
5
  SHA512:
6
- metadata.gz: 503b09dd21ed7ac3d67b212101e99cad2d904985352ce2fc954c01b6645dcf52d8ec408824a5366a6da7e08b91bbab1df857e2048e7a5f5b5c6a48956d129818
7
- data.tar.gz: 957ac5530821e4c0572559d0eed5ef4ff71c1a4ff2502da469f91a44d3f9095311aad53de4129d62b7e5d0fb08ceda71f56d20ce2e3ad13f88e133cdbe3c98e6
6
+ metadata.gz: a18a6405d54f52cbca6a0440166c3b702e54f548508f4c06bbd0be54ba0e4238f6c43b06d6b13766fc604ca8078b96fcb836584e1f1f21105a03dd78dca698d8
7
+ data.tar.gz: 52670bc61ce13789bbbff117cf20782389aac1faf80d87675766e15b2503ab2a7615eb5e73487e13b1b8d91b1b8ce52328af899e16db9d394362eb8f19beb114
@@ -1,13 +1,14 @@
1
1
  class G5FoundationClient::Location
2
2
  extend G5FoundationClient::FindableByUid
3
3
 
4
- attr_accessor :location_hash
4
+ attr_accessor :location_hash, :client
5
5
 
6
6
  def initialize(attrs)
7
7
  self.location_hash = attrs.fetch(:location, attrs)
8
+ self.client = self.location_hash.delete(:client)
8
9
  end
9
10
 
10
- [:id, :uid, :client, :client_uid, :client_id, :name, :corporate, :created_at, :updated_at, :urn,
11
+ [:id, :uid, :client_uid, :client_id, :name, :corporate, :created_at, :updated_at, :urn,
11
12
  :street_address_1, :street_address_2, :city, :state, :postal_code,
12
13
  :fax, :email, :hours, :twitter_username, :facebook_username, :yelp_username,
13
14
  :pinterest_username, :foursquare_username, :tumblr_username, :instagram_username,
@@ -30,7 +31,7 @@ class G5FoundationClient::Location
30
31
  :recycling_center, :swimming_pool, :hot_tub, :storage_available, :tennis_court, :wifi_available, :other_community_amenities,
31
32
  :primary_offering_other, :ga_tracking_id, :ga_profile_id, :landmark_1_type, :landmark_1_name, :landmark_2_type, :landmark_2_name,
32
33
  :property_feature_1, :property_feature_2, :property_feature_3, :apartment_amenity_1, :apartment_amenity_2,
33
- :community_amenity_1, :community_amenity_2].each do |field|
34
+ :community_amenity_1, :community_amenity_2, :status].each do |field|
34
35
  define_method(field) { self.location_hash[field] }
35
36
  end
36
37
 
@@ -1,10 +1,11 @@
1
1
  FactoryGirl.define do
2
2
  factory :g5_location, class: G5FoundationClient::Location do
3
- name "Test Location"
4
- phone_number "123-123-1234"
3
+ hash_params { {uid: 'http://client.uid', name: 'metro', phone_number: '123-132-3333'} }
4
+ initialize_with { new(hash_params) }
5
5
  end
6
6
 
7
7
  factory :g5_client, class: G5FoundationClient::Client do
8
- name "Test Client"
8
+ hash_params { {name: "Test Client"} }
9
+ initialize_with { new(hash_params) }
9
10
  end
10
11
  end
@@ -1,3 +1,3 @@
1
1
  module G5FoundationClient
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.11'
3
3
  end
@@ -1 +1,184 @@
1
- {"client":{"id":2,"uid":"http://192.168.33.30:3000/clients/g5-c-6hng302-no-store","name":"no store","urn":"g5-c-6hng302-no-store","vertical":"Self-Storage","street_address_1":"20270 W North Ave","street_address_2":"","city":"Brookfield","state":"WI","postal_code":"53045-4278","fax":"(262) 744-9458","email":"perry@hertler.org","tel":"(262) 744-9458","domain_type":"SingleDomainClient","domain":"http://nostore.com","created_at":"2014-10-08T20:27:36.008Z","updated_at":"2014-10-08T20:27:36.008Z","locations":[{"id":3,"uid":"http://192.168.33.30:3000/clients/g5-c-6hng302-no-store/locations/g5-cl-6hng303-brussels","client_id":2,"client_uid":"http://192.168.33.30:3000/clients/g5-c-6hng302-no-store","name":"brussels","corporate":false,"created_at":"2014-10-08T20:27:36.011Z","updated_at":"2014-10-08T20:27:36.011Z","urn":"g5-cl-6hng303-brussels","street_address_1":"20270 W North Ave","street_address_2":"","city":"Brookfield","state":"WI","postal_code":"53045-4278","fax":"(262) 744-9458","email":"perry@hertler.org","hours":"","twitter_username":"","facebook_username":"","yelp_username":"","pinterest_username":"","foursquare_username":"","tumblr_username":"","instagram_username":"","vimeo_username":"","youtube_username":"","domain":"http://nostore.com/brussels","phone_number":"(262) 744-9458","neighborhood":"","boat_storage":false,"business_storage":false,"gate_access":false,"security_monitoring":false,"business_center":false,"climate_controlled":false,"heated_cooled":false,"friendly_staff":false,"covered_drivethru":false,"covered_loading":false,"rv_boat_storage":false,"outside_parking":false,"deliveries":false,"dollies_carts":false,"digital_surveillance":false,"drive_up_access":false,"electronic_gate":false,"uhaul_trucks":false,"budget_trucks":false,"moving_trucks":false,"free_truck":false,"fenced_lighted":false,"ground_level_units":false,"high_ceilings":false,"individual_alarmed_units":false,"mail_boxes":false,"major_credit_cards":false,"military_discounts":false,"student_discount":false,"senior_discount":false,"month_to_month":false,"no_admin_fee":false,"no_deposits":false,"no_late_fees":false,"online_bill_pay":false,"packing_moving_supplies":false,"boxes_locks":false,"tenant_insurance":false,"truck_rentals":false,"wide_driveways":false,"wine_storage":false,"other_features":"","rv_storage":false,"seven_day_access":false,"other_storage":"","specific_demographic":"","primary_offering":"","secondary_other":"","secondary_condo":false,"secondary_townhomes":false,"secondary_apartments":false,"floor_plans":"","nearby_schools":"","highrise_structure":false,"garden_structure":false,"townhome_structure":false,"modern_structure":false,"nearby_employers":"","dogs_allowed":false,"cats_allowed":false,"accessibility":"0","air_conditioned":false,"cable_included":false,"ceiling_fans":false,"custom_cabinetry":false,"dishwasher":false,"energy_efficient":false,"fireplace":false,"granite_counters":false,"hardwood_floors":false,"private_balcony":false,"private_patio":false,"refrigerator":false,"stainless_appliances":false,"smoke_free":false,"style_design":"","style_cost":"","walkin_closet":false,"washer_dryer":false,"has_view":false,"other_amenities":"","carport_parking":false,"club_house":false,"dog_park":false,"corporate_suites":false,"family_friendly":false,"fitness_center":false,"furnished_apartments":false,"garages":false,"gated_entrance":false,"laundry_facilities":false,"online_rental_payments":false,"onsite_management":false,"close_park":false,"pet_friendly":false,"playground":false,"recycling_center":false,"swimming_pool":false,"hot_tub":false,"storage_available":false,"tennis_court":false,"wifi_available":false,"other_community_amenities":"","primary_offering_other":null,"ga_tracking_id":"","ga_profile_id":"","landmark_1_type":"","landmark_1_name":"","landmark_2_type":"","landmark_2_name":"","property_feature_1":"","property_feature_2":"","property_feature_3":"","apartment_amenity_1":"","apartment_amenity_2":"","community_amenity_1":"","community_amenity_2":"","locations_integration_settings":[{"location_id":3,"vendor":"SiteLink","vendor_action":"inventory","id":2,"strategy_name":"vsn","vendor_user_name":"brusselsuname","vendor_password":"vp","vendor_endpoint":"ven","created_at":"2014-10-08T20:28:26.154Z","updated_at":"2014-10-08T20:28:26.154Z","channel":"4"}]}]}}
1
+ {"client": {
2
+ "id": 2,
3
+ "uid": "http://192.168.33.30:3000/clients/g5-c-6hng302-no-store",
4
+ "name": "no store",
5
+ "urn": "g5-c-6hng302-no-store",
6
+ "vertical": "Self-Storage",
7
+ "street_address_1": "20270 W North Ave",
8
+ "street_address_2": "",
9
+ "city": "Brookfield",
10
+ "state": "WI",
11
+ "postal_code": "53045-4278",
12
+ "fax": "(262) 744-9458",
13
+ "email": "perry@hertler.org",
14
+ "tel": "(262) 744-9458",
15
+ "domain_type": "SingleDomainClient",
16
+ "domain": "http://nostore.com",
17
+ "created_at": "2014-10-08T20:27:36.008Z",
18
+ "updated_at": "2014-10-08T20:27:36.008Z",
19
+ "locations": [
20
+ {
21
+ "id": 3,
22
+ "uid": "http://192.168.33.30:3000/clients/g5-c-6hng302-no-store/locations/g5-cl-6hng303-brussels",
23
+ "client_id": 2,
24
+ "client_uid": "http://192.168.33.30:3000/clients/g5-c-6hng302-no-store",
25
+ "name": "brussels",
26
+ "corporate": false,
27
+ "created_at": "2014-10-08T20:27:36.011Z",
28
+ "updated_at": "2014-10-08T20:27:36.011Z",
29
+ "urn": "g5-cl-6hng303-brussels",
30
+ "street_address_1": "20270 W North Ave",
31
+ "street_address_2": "",
32
+ "city": "Brookfield",
33
+ "state": "WI",
34
+ "postal_code": "53045-4278",
35
+ "fax": "(262) 744-9458",
36
+ "email": "perry@hertler.org",
37
+ "hours": "",
38
+ "twitter_username": "",
39
+ "facebook_username": "",
40
+ "yelp_username": "",
41
+ "pinterest_username": "",
42
+ "foursquare_username": "",
43
+ "tumblr_username": "",
44
+ "instagram_username": "",
45
+ "vimeo_username": "",
46
+ "youtube_username": "",
47
+ "domain": "http://nostore.com/brussels",
48
+ "phone_number": "(262) 744-9458",
49
+ "neighborhood": "",
50
+ "boat_storage": false,
51
+ "business_storage": false,
52
+ "gate_access": false,
53
+ "security_monitoring": false,
54
+ "business_center": false,
55
+ "climate_controlled": false,
56
+ "heated_cooled": false,
57
+ "friendly_staff": false,
58
+ "covered_drivethru": false,
59
+ "covered_loading": false,
60
+ "rv_boat_storage": false,
61
+ "outside_parking": false,
62
+ "deliveries": false,
63
+ "dollies_carts": false,
64
+ "digital_surveillance": false,
65
+ "drive_up_access": false,
66
+ "electronic_gate": false,
67
+ "uhaul_trucks": false,
68
+ "budget_trucks": false,
69
+ "moving_trucks": false,
70
+ "free_truck": false,
71
+ "fenced_lighted": false,
72
+ "ground_level_units": false,
73
+ "high_ceilings": false,
74
+ "individual_alarmed_units": false,
75
+ "mail_boxes": false,
76
+ "major_credit_cards": false,
77
+ "military_discounts": false,
78
+ "student_discount": false,
79
+ "senior_discount": false,
80
+ "month_to_month": false,
81
+ "no_admin_fee": false,
82
+ "no_deposits": false,
83
+ "no_late_fees": false,
84
+ "online_bill_pay": false,
85
+ "packing_moving_supplies": false,
86
+ "boxes_locks": false,
87
+ "tenant_insurance": false,
88
+ "truck_rentals": false,
89
+ "wide_driveways": false,
90
+ "wine_storage": false,
91
+ "other_features": "",
92
+ "rv_storage": false,
93
+ "seven_day_access": false,
94
+ "other_storage": "",
95
+ "specific_demographic": "",
96
+ "primary_offering": "",
97
+ "secondary_other": "",
98
+ "secondary_condo": false,
99
+ "secondary_townhomes": false,
100
+ "secondary_apartments": false,
101
+ "floor_plans": "",
102
+ "nearby_schools": "",
103
+ "highrise_structure": false,
104
+ "garden_structure": false,
105
+ "townhome_structure": false,
106
+ "modern_structure": false,
107
+ "nearby_employers": "",
108
+ "dogs_allowed": false,
109
+ "cats_allowed": false,
110
+ "accessibility": "0",
111
+ "air_conditioned": false,
112
+ "cable_included": false,
113
+ "ceiling_fans": false,
114
+ "custom_cabinetry": false,
115
+ "dishwasher": false,
116
+ "energy_efficient": false,
117
+ "fireplace": false,
118
+ "granite_counters": false,
119
+ "hardwood_floors": false,
120
+ "private_balcony": false,
121
+ "private_patio": false,
122
+ "refrigerator": false,
123
+ "stainless_appliances": false,
124
+ "smoke_free": false,
125
+ "style_design": "",
126
+ "style_cost": "",
127
+ "walkin_closet": false,
128
+ "washer_dryer": false,
129
+ "has_view": false,
130
+ "other_amenities": "",
131
+ "carport_parking": false,
132
+ "club_house": false,
133
+ "dog_park": false,
134
+ "corporate_suites": false,
135
+ "family_friendly": false,
136
+ "fitness_center": false,
137
+ "furnished_apartments": false,
138
+ "garages": false,
139
+ "gated_entrance": false,
140
+ "laundry_facilities": false,
141
+ "online_rental_payments": false,
142
+ "onsite_management": false,
143
+ "close_park": false,
144
+ "pet_friendly": false,
145
+ "playground": false,
146
+ "recycling_center": false,
147
+ "swimming_pool": false,
148
+ "hot_tub": false,
149
+ "storage_available": false,
150
+ "tennis_court": false,
151
+ "wifi_available": false,
152
+ "other_community_amenities": "",
153
+ "primary_offering_other": null,
154
+ "ga_tracking_id": "",
155
+ "ga_profile_id": "",
156
+ "landmark_1_type": "",
157
+ "landmark_1_name": "",
158
+ "landmark_2_type": "",
159
+ "landmark_2_name": "",
160
+ "property_feature_1": "",
161
+ "property_feature_2": "",
162
+ "property_feature_3": "",
163
+ "apartment_amenity_1": "",
164
+ "apartment_amenity_2": "",
165
+ "community_amenity_1": "",
166
+ "community_amenity_2": "",
167
+ "locations_integration_settings": [
168
+ {
169
+ "location_id": 3,
170
+ "vendor": "SiteLink",
171
+ "vendor_action": "inventory",
172
+ "id": 2,
173
+ "strategy_name": "vsn",
174
+ "vendor_user_name": "brusselsuname",
175
+ "vendor_password": "vp",
176
+ "vendor_endpoint": "ven",
177
+ "created_at": "2014-10-08T20:28:26.154Z",
178
+ "updated_at": "2014-10-08T20:28:26.154Z",
179
+ "channel": "4"
180
+ }
181
+ ]
182
+ }
183
+ ]
184
+ }}
@@ -4,6 +4,7 @@ describe G5FoundationClient::Location do
4
4
  before { G5FoundationClient.access_token = "token" }
5
5
 
6
6
  describe "instantiating with a hash" do
7
+ let(:client) { G5FoundationClient::Client.new(uid: 'myclient') }
7
8
  subject do
8
9
  G5FoundationClient::Location.new(
9
10
  uid: "http://example.com/urn",
@@ -23,10 +24,13 @@ describe G5FoundationClient::Location do
23
24
  street_address_2: "apt 2",
24
25
  state: "South Testakota",
25
26
  city: "Testville",
26
- postal_code: "31337"
27
+ postal_code: "31337",
28
+ status: "Pending",
29
+ client: client
27
30
  )
28
31
  end
29
32
 
33
+ its(:client) { should eql(client) }
30
34
  its(:uid) { should eql("http://example.com/urn") }
31
35
  its(:urn) { should eql("urn") }
32
36
  its(:client_uid) { should eql("http://example.com/client_uid") }
@@ -44,8 +48,13 @@ describe G5FoundationClient::Location do
44
48
  its(:region) { should eql("South Testakota") }
45
49
  its(:locality) { should eql("Testville") }
46
50
  its(:postal_code) { should eql("31337") }
51
+ its(:status) { should eql("Pending") }
47
52
  its(:inventory_integration_settings) { should be_nil }
48
53
  its(:lead_integration_settings) { should be_nil }
54
+
55
+ it 'deletes client from hash' do
56
+ expect(subject.location_hash[:client]).to be_nil
57
+ end
49
58
  end
50
59
 
51
60
  describe '.find_by_uid' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_foundation_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Petersen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport