postcodeinfo-client-ruby 0.1.2 → 0.1.3

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: f3aa26610d744e3aa76e5fc43f60920375f7e4e0
4
- data.tar.gz: 11539d5fb3bdd6ebe1aa8300b4f1d93a3985747a
3
+ metadata.gz: a1cc29fc252abb63673bcdbc1eac1e65c44f3afa
4
+ data.tar.gz: c89795f10cbda5f945032d5df031525ea8a8dce6
5
5
  SHA512:
6
- metadata.gz: 60eea5c8612ff37befa8645db051add2e918acdc9d97d2eabed2a21729641b6866318e95ae10e2a89322047c573889de5003b311fee014a1f6cea96f5fed8467
7
- data.tar.gz: a5ed3ae14d8233ea2fe5ea5a890b0f38dd0d7af12a5e898a7b9869eb136305252a617cd905c5d823024d95278c259f0320915f94f04b565d774183de64014f03
6
+ metadata.gz: 84bba1eac23473f8fba00e73bcf59ca43bdc099745f9dceb6e812fa0ffee55c213bd2284e5f1bef328d870ce0a11eb9641419f86b03abd7e0c2904444b13c854
7
+ data.tar.gz: 8ca4410e0121c5677ed0fcfd4489be16b6fdc2581569d10e792b6bbf5b9ab035118d79f0d3d6ebcb18d51603cf3d2bc84ba1194bd0817dc826d70a2aefac6f52
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -51,8 +51,8 @@ module PostcodeInfo
51
51
 
52
52
  def set_coordinates!(info)
53
53
  if info[:centre]
54
- @latitude = info[:centre][:latitude]
55
- @longitude = info[:centre][:longitude]
54
+ @latitude = info[:centre][:coordinates][0]
55
+ @longitude = info[:centre][:coordinates][1]
56
56
  end
57
57
  end
58
58
 
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: postcodeinfo-client-ruby 0.1.2 ruby lib
5
+ # stub: postcodeinfo-client-ruby 0.1.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "postcodeinfo-client-ruby"
9
- s.version = "0.1.2"
9
+ s.version = "0.1.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -197,14 +197,19 @@ describe PostcodeInfo::Postcode do
197
197
 
198
198
  describe 'set_coordinates!' do
199
199
  context 'when the given info has a :centre key' do
200
- let(:info){ {centre: {latitude: 1.0, longitude: 256.8}} }
201
-
202
- it 'stores the latitude sub-key as @latitude' do
200
+ let(:info){ {centre: {
201
+ type: 'Point',
202
+ coordinates:[1.0, 256.8]
203
+ }
204
+ }
205
+ }
206
+
207
+ it 'stores the second coordinate as @latitude' do
203
208
  postcode.send(:set_coordinates!, info)
204
209
  expect(postcode.send(:instance_variable_get, '@latitude')).to eq(1.0)
205
210
  end
206
211
 
207
- it 'stores the longitude sub-key as @longitude' do
212
+ it 'stores the first coordinate as @longitude' do
208
213
  postcode.send(:set_coordinates!, info)
209
214
  expect(postcode.send(:instance_variable_get, '@longitude')).to eq(256.8)
210
215
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postcodeinfo-client-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Al Davidson