uk_county_locator 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 71dae39e4b8fc0419db0d2b96a848b3b0a7988f4fac95d9c77ebb2af7d7c1ae4
4
- data.tar.gz: 8bad8800d83408e8fa341ddc9adfeaf92d364e907f199f6419758c74489541ac
3
+ metadata.gz: 2fb8e6a5181df9742a4a7a1acbfa5bd120af1a6b07ffa2927fdfe9faaf76944e
4
+ data.tar.gz: cb046d44f777d5e2fa3a173a2414cc8f4bd78ce8a7b423f5817dd04abac474b8
5
5
  SHA512:
6
- metadata.gz: 43c81add736be9a7a09c09c078be512ef8d9db2f6adcbc47a39bb3ff5674745ca8691b60e766943c6447345a554a9188737657014b4b1defc2b2563b133adf39
7
- data.tar.gz: d8b17138066ee64cdcaaa320ee632a5f7bc2b824d44ea24a2745a488499d80a5a0e3b722d1d7a08618d8fb1e68cccc2fe2046c450f326bb743b9803b55f02a8a
6
+ metadata.gz: 71456f516ad63de88470e08b26f58cef9b2dcaa08efeb0cbadb96f5e2674bf1da54cdb3b4c940b48b4368a1612e63d332365dbd7370caccbc508b8faf50e8013
7
+ data.tar.gz: 2a2d198c745702f1ee0fdef73e8c5548f95d9fda3fe6473b889544483a335632471d2016e64d3733a89b67075e5a372cabb8d29f1ac95caa4e327f4c01dc61d1
@@ -41,7 +41,7 @@ module UkCountyLocator
41
41
  end
42
42
 
43
43
  def find_county_within(polygons)
44
- polylines_service.point_inside_polygon?(polygons)
44
+ polylines_service.located_county(polygons)
45
45
  end
46
46
 
47
47
  def polylines_service
@@ -15,12 +15,12 @@ class PolylinesService
15
15
  Polylines::Decoder.decode_polyline(polygon).map { |lng, lat| Geokit::LatLng.new(lat, lng) }
16
16
  end
17
17
 
18
- def point_inside_polygon?(polygons)
18
+ def located_county(polygons)
19
19
  return nil if @point.nil?
20
20
 
21
21
  polygons.detect do |name, polygon|
22
22
  geo_polygon = Geokit::Polygon.new(polygon_to_array(polygon: polygon))
23
23
  geo_polygon.contains?(@point) ? name : nil
24
- end.first
24
+ end&.first
25
25
  end
26
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UkCountyLocator
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uk_county_locator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edward Beesley
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-07-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: geokit
@@ -50,7 +49,6 @@ dependencies:
50
49
  - - "<"
51
50
  - !ruby/object:Gem::Version
52
51
  version: '1.0'
53
- description:
54
52
  email:
55
53
  - ed@homeflow.co.uk
56
54
  executables: []
@@ -89,7 +87,6 @@ metadata:
89
87
  homepage_uri: https://github.com/EdBeese/uk_county_locator
90
88
  source_code_uri: https://github.com/EdBeese/uk_county_locator
91
89
  changelog_uri: https://github.com/EdBeese/uk_county_locator/blob/main/CHANGELOG.md
92
- post_install_message:
93
90
  rdoc_options: []
94
91
  require_paths:
95
92
  - lib
@@ -104,8 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
101
  - !ruby/object:Gem::Version
105
102
  version: '0'
106
103
  requirements: []
107
- rubygems_version: 3.4.20
108
- signing_key:
104
+ rubygems_version: 3.7.0
109
105
  specification_version: 4
110
106
  summary: A Ruby gem that stores encoded polygon data for UK counties, with the ability
111
107
  to return county information for given coordinates.