mits 0.2.1 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60a543cc366b0d808fb57d9bc4f301b0fcb94b58
4
- data.tar.gz: 8c41a13e00bd03e94da1d05ab767dc04cf2de651
3
+ metadata.gz: c28b6948a85f7c98e0b37ff069255a868fee2f9d
4
+ data.tar.gz: 3cc88d125da8bc56c580a39ca4c31b0dc667479d
5
5
  SHA512:
6
- metadata.gz: 51f5947b37d9e4abbc4753e15bae02c5cc37c65a1463035bcd9288eafd1c5674982bec4018fc89fbaa53223d36b39e1bd543120df386fc48d292bf1908619da5
7
- data.tar.gz: e89694e617260d903314b2be2930c1e21c46ef0b0f1c7e20d75652b5893e4cb682016284ffd177633260f95f79f43c828f43f898b95e0318c0ed3cfa7375a165
6
+ metadata.gz: 40e77f4afbe66aef1d6934f2aa54ec9dc23cb0d7f58293818b3f9ca52e1ca19331680e66bbaa0e3a80155f8ce78ad264bcc13592d3d1c3d1f74ad332cc6c7aef
7
+ data.tar.gz: b68d4615a4c627944592ca743f5dfbda8a4a5b0aca32f0ded11ab9d126b2812b639d3972a5c391f4a2a98d6722cb0b7533d72b41eea47878143f140c9c1efe24
@@ -8,6 +8,7 @@ module MITS
8
8
  attribute :country
9
9
  attribute :county_name
10
10
  attribute :description
11
+ attribute :email
11
12
  attribute :latitude
12
13
  attribute :longitude
13
14
  attribute :postal_code
@@ -7,6 +7,7 @@ require_relative 'file'
7
7
  require_relative 'floorplan'
8
8
  require_relative 'pet'
9
9
  require_relative 'pet_policy'
10
+ require_relative 'phone'
10
11
  require_relative 'policy'
11
12
  require_relative 'property'
12
13
 
@@ -18,6 +19,7 @@ require_relative 'mapper/fees_mapper'
18
19
  require_relative 'mapper/files_mapper'
19
20
  require_relative 'mapper/floorplan_mapper'
20
21
  require_relative 'mapper/pet_policy_mapper'
22
+ require_relative 'mapper/phones_mapper'
21
23
  require_relative 'mapper/policy_mapper'
22
24
  require_relative 'mapper/property_mapper'
23
25
 
@@ -34,6 +36,7 @@ module MITS
34
36
  extend FilesMapper
35
37
  extend FloorplanMapper
36
38
  extend PetPolicyMapper
39
+ extend PhonesMapper
37
40
  extend PolicyMapper
38
41
  extend PropertyMapper
39
42
 
@@ -22,6 +22,7 @@ module MITS
22
22
  country: try(tag[:Country], :strip),
23
23
  country_name: try(tag[:CountyName], :strip),
24
24
  description: try(tag[:Description], :strip),
25
+ email: try(tag[:Email], :strip),
25
26
  postal_code: try(tag[:PostalCode], :strip),
26
27
  province: try(tag[:Province], :strip),
27
28
  state: try(tag[:State], :strip),
@@ -0,0 +1,18 @@
1
+ module MITS
2
+ module V3_0
3
+ module Mapper
4
+ module PhonesMapper
5
+ def phones(tags, entity = Phone)
6
+ tags = [tags] unless tags.is_a? Array
7
+ tags.map { |tag| phone(tag, entity) }
8
+ end
9
+
10
+ def phone(tag, entity = Phone)
11
+ entity.new(extension: tag[:Extension],
12
+ number: tag[:PhoneNumber],
13
+ type: tag[:PhoneType])
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -32,6 +32,7 @@ module MITS
32
32
  details[:deposit] = try(tag[:Deposit], :deposits)
33
33
  details[:fees] = try(tag[:Fee], :fees)
34
34
  details[:files] = try(tag[:File], :files)
35
+ details[:phones] = try(tag[:PropertyID][:Phone], :phones)
35
36
  details[:policy] = try(tag[:Policy], :policy)
36
37
  details[:floorplans] = try(tag[:Floorplan], :floorplans)
37
38
 
@@ -0,0 +1,11 @@
1
+ module MITS
2
+ module V3_0
3
+ class Phone
4
+ include SimpleObjects::Base
5
+
6
+ attribute :extension
7
+ attribute :number
8
+ attribute :type
9
+ end
10
+ end
11
+ end
@@ -13,6 +13,7 @@ module MITS
13
13
  attribute :floorplans
14
14
  attribute :id
15
15
  attribute :name
16
+ attribute :phones
16
17
  attribute :policy
17
18
  attribute :summary
18
19
  attribute :type
@@ -9,6 +9,7 @@ module MITS
9
9
  attribute :country
10
10
  attribute :county_name
11
11
  attribute :description
12
+ attribute :email
12
13
  attribute :latitude
13
14
  attribute :longitude
14
15
  attribute :postal_code
@@ -20,6 +20,7 @@ require_relative '../v3.0/mapper/deposit_mapper'
20
20
  require_relative '../v3.0/mapper/fees_mapper'
21
21
  require_relative '../v3.0/mapper/files_mapper'
22
22
  require_relative '../v3.0/mapper/pet_policy_mapper'
23
+ require_relative '../v3.0/mapper/phones_mapper'
23
24
  require_relative '../v3.0/mapper/policy_mapper'
24
25
 
25
26
 
@@ -34,6 +35,7 @@ module MITS
34
35
  extend V3_0::Mapper::FeesMapper
35
36
  extend V3_0::Mapper::FilesMapper
36
37
  extend V3_0::Mapper::PetPolicyMapper
38
+ extend V3_0::Mapper::PhonesMapper
37
39
  extend V3_0::Mapper::PolicyMapper
38
40
 
39
41
  extend AddressMapper
File without changes
@@ -0,0 +1,8 @@
1
+ require 'mits/v3.0/phone'
2
+
3
+ module MITS
4
+ module V4_1
5
+ class Phone < V3_0::Phone
6
+ end
7
+ end
8
+ end
@@ -12,6 +12,7 @@ module MITS
12
12
  attribute :files
13
13
  attribute :id
14
14
  attribute :name
15
+ attribute :phones
15
16
  attribute :policy
16
17
  attribute :summary
17
18
  attribute :type
@@ -1,3 +1,3 @@
1
1
  module MITS
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -9,6 +9,7 @@ module MITS
9
9
  it { is_expected.to respond_to(:country) }
10
10
  it { is_expected.to respond_to(:county_name) }
11
11
  it { is_expected.to respond_to(:description) }
12
+ it { is_expected.to respond_to(:email) }
12
13
  it { is_expected.to respond_to(:latitude) }
13
14
  it { is_expected.to respond_to(:longitude) }
14
15
  it { is_expected.to respond_to(:postal_code) }
@@ -15,6 +15,7 @@ module MITS
15
15
  expect(subject.address).to eq '11401 Dr. Martin Luther King Jr. St N'
16
16
  expect(subject.city).to eq 'Saint Petersburg'
17
17
  expect(subject.state).to eq 'FL'
18
+ expect(subject.email).to eq 'sales@camdenliving.com'
18
19
  end
19
20
  end
20
21
 
@@ -146,6 +147,20 @@ module MITS
146
147
  end
147
148
  end
148
149
 
150
+ describe '.phones' do
151
+ subject { Mapper.phones(fixture[:PropertyID][:Phone]) }
152
+
153
+ it { is_expected.to be_a Array }
154
+
155
+ it 'includes individual phone numbers' do
156
+ first = subject.first
157
+
158
+ expect(first.extension).to be_nil
159
+ expect(first.number).to eq '727-577-7557'
160
+ expect(first.type).to eq 'office'
161
+ end
162
+ end
163
+
149
164
  describe '.policy' do
150
165
  subject { Mapper.policy(fixture[:Policy]) }
151
166
 
@@ -172,6 +187,8 @@ module MITS
172
187
  expect(subject.files).to be_a Array
173
188
  expect(subject.id).to eq '89851'
174
189
  expect(subject.name).to eq 'Camden Lakes'
190
+ expect(subject.phones).to be_a Array
191
+ expect(subject.phones.first).to be_a Phone
175
192
  expect(subject.policy).to be_a Policy
176
193
  expect(subject.summary).to eq 'a short description'
177
194
  expect(subject.floorplans).to be_a Array
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+ require 'mits/v3.0/phone'
3
+
4
+ module MITS
5
+ module V3_0
6
+ describe Phone do
7
+ it { is_expected.to respond_to(:extension) }
8
+ it { is_expected.to respond_to(:number) }
9
+ it { is_expected.to respond_to(:type) }
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
- require 'mits/v4.1/property'
2
+ require 'mits/v3.0/property'
3
3
 
4
4
  module MITS
5
5
  module V3_0
@@ -13,6 +13,7 @@ module MITS
13
13
  it { is_expected.to respond_to(:files) }
14
14
  it { is_expected.to respond_to(:id) }
15
15
  it { is_expected.to respond_to(:name) }
16
+ it { is_expected.to respond_to(:phones) }
16
17
  it { is_expected.to respond_to(:policy) }
17
18
  it { is_expected.to respond_to(:summary) }
18
19
  it { is_expected.to respond_to(:type) }
@@ -10,6 +10,7 @@ module MITS
10
10
  it { is_expected.to respond_to(:country) }
11
11
  it { is_expected.to respond_to(:county_name) }
12
12
  it { is_expected.to respond_to(:description) }
13
+ it { is_expected.to respond_to(:email) }
13
14
  it { is_expected.to respond_to(:latitude) }
14
15
  it { is_expected.to respond_to(:longitude) }
15
16
  it { is_expected.to respond_to(:postal_code) }
@@ -141,6 +141,20 @@ module MITS
141
141
  end
142
142
  end
143
143
 
144
+ describe '.phones' do
145
+ subject { Mapper.phones(fixture[:PropertyID][:Phone]) }
146
+
147
+ it { is_expected.to be_a Array }
148
+
149
+ it 'includes individual phone numbers' do
150
+ first = subject.first
151
+
152
+ expect(first.extension).to be_nil
153
+ expect(first.number).to eq '4449995555'
154
+ expect(first.type).to eq 'office'
155
+ end
156
+ end
157
+
144
158
  describe '.policy' do
145
159
  subject { Mapper.policy(fixture[:Policy], Policy, PetPolicy, Pet) }
146
160
 
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+ require 'mits/v4.1/phone'
3
+
4
+ module MITS
5
+ module V3_0
6
+ describe Phone do
7
+ it { is_expected.to respond_to(:extension) }
8
+ it { is_expected.to respond_to(:number) }
9
+ it { is_expected.to respond_to(:type) }
10
+ end
11
+ end
12
+ end
@@ -13,6 +13,7 @@ module MITS
13
13
  it { is_expected.to respond_to(:files) }
14
14
  it { is_expected.to respond_to(:id) }
15
15
  it { is_expected.to respond_to(:name) }
16
+ it { is_expected.to respond_to(:phones) }
16
17
  it { is_expected.to respond_to(:policy) }
17
18
  it { is_expected.to respond_to(:summary) }
18
19
  it { is_expected.to respond_to(:type) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Callan
@@ -184,10 +184,12 @@ files:
184
184
  - lib/mits/v3.0/mapper/files_mapper.rb
185
185
  - lib/mits/v3.0/mapper/floorplan_mapper.rb
186
186
  - lib/mits/v3.0/mapper/pet_policy_mapper.rb
187
+ - lib/mits/v3.0/mapper/phones_mapper.rb
187
188
  - lib/mits/v3.0/mapper/policy_mapper.rb
188
189
  - lib/mits/v3.0/mapper/property_mapper.rb
189
190
  - lib/mits/v3.0/pet.rb
190
191
  - lib/mits/v3.0/pet_policy.rb
192
+ - lib/mits/v3.0/phone.rb
191
193
  - lib/mits/v3.0/policy.rb
192
194
  - lib/mits/v3.0/property.rb
193
195
  - lib/mits/v4.1/address.rb
@@ -199,10 +201,12 @@ files:
199
201
  - lib/mits/v4.1/mapper.rb
200
202
  - lib/mits/v4.1/mapper/address_mapper.rb
201
203
  - lib/mits/v4.1/mapper/company_mapper.rb
204
+ - lib/mits/v4.1/mapper/phones_mapper.rb
202
205
  - lib/mits/v4.1/mapper/property_mapper.rb
203
206
  - lib/mits/v4.1/mapper/units_mapper.rb
204
207
  - lib/mits/v4.1/pet.rb
205
208
  - lib/mits/v4.1/pet_policy.rb
209
+ - lib/mits/v4.1/phone.rb
206
210
  - lib/mits/v4.1/policy.rb
207
211
  - lib/mits/v4.1/property.rb
208
212
  - lib/mits/v4.1/unit.rb
@@ -223,6 +227,7 @@ files:
223
227
  - spec/lib/mits/v3.0/mapper_spec.rb
224
228
  - spec/lib/mits/v3.0/pet_policy_spec.rb
225
229
  - spec/lib/mits/v3.0/pet_spec.rb
230
+ - spec/lib/mits/v3.0/phone_spec.rb
226
231
  - spec/lib/mits/v3.0/property_spec.rb
227
232
  - spec/lib/mits/v4.1/address_spec.rb
228
233
  - spec/lib/mits/v4.1/amenity_spec.rb
@@ -233,6 +238,7 @@ files:
233
238
  - spec/lib/mits/v4.1/mapper_spec.rb
234
239
  - spec/lib/mits/v4.1/pet_policy_spec.rb
235
240
  - spec/lib/mits/v4.1/pet_spec.rb
241
+ - spec/lib/mits/v4.1/phone_spec.rb
236
242
  - spec/lib/mits/v4.1/property_spec.rb
237
243
  - spec/lib/mits/v4.1/unit_spec.rb
238
244
  - spec/spec_helper.rb
@@ -276,6 +282,7 @@ test_files:
276
282
  - spec/lib/mits/v3.0/mapper_spec.rb
277
283
  - spec/lib/mits/v3.0/pet_policy_spec.rb
278
284
  - spec/lib/mits/v3.0/pet_spec.rb
285
+ - spec/lib/mits/v3.0/phone_spec.rb
279
286
  - spec/lib/mits/v3.0/property_spec.rb
280
287
  - spec/lib/mits/v4.1/address_spec.rb
281
288
  - spec/lib/mits/v4.1/amenity_spec.rb
@@ -286,6 +293,7 @@ test_files:
286
293
  - spec/lib/mits/v4.1/mapper_spec.rb
287
294
  - spec/lib/mits/v4.1/pet_policy_spec.rb
288
295
  - spec/lib/mits/v4.1/pet_spec.rb
296
+ - spec/lib/mits/v4.1/phone_spec.rb
289
297
  - spec/lib/mits/v4.1/property_spec.rb
290
298
  - spec/lib/mits/v4.1/unit_spec.rb
291
299
  - spec/spec_helper.rb