national_grid 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/national_grid.rb +1 -0
- data/lib/national_grid/easting_northing.rb +1 -0
- data/lib/national_grid/latitude_longitude.rb +1 -0
- data/lib/national_grid/round.rb +7 -0
- data/lib/national_grid/version.rb +1 -1
- data/test/national_grid/easting_northing_test.rb +8 -0
- data/test/national_grid/latitude_longitude_test.rb +8 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ec0e110d4ad5b1c699d302874a93102a9d49f1d
|
4
|
+
data.tar.gz: 3bbd7e3972857d902d3915ce503a37f5f21b3228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 034ffa69b41306e1998688c295c84b127c29b5b670baa012221f63b972fab0b9fb6d837d620cc5856b6cedaf8d28fac7bcee64b28d701ca64b52e8190b38b64a
|
7
|
+
data.tar.gz: a2b1a2b9c4d25129c544835a692daaa64ef1ab361b219ead423e36344bc50689e5cf44d8a0c2e83fd03618ce6e81d3ff586f652dd816870a61c954beb48db7fa
|
data/lib/national_grid.rb
CHANGED
@@ -43,6 +43,14 @@ module NationalGrid
|
|
43
43
|
assert_nil EastingNorthing.new(999999.999, 999999.999, 99.999).to_latitude_longitude
|
44
44
|
end
|
45
45
|
|
46
|
+
def test_round
|
47
|
+
point = EastingNorthing.new(12.3456, 78.9012, 34.5678).round(3)
|
48
|
+
|
49
|
+
assert_equal 12.346, point.easting
|
50
|
+
assert_equal 78.901, point.northing
|
51
|
+
assert_equal 34.568, point.elevation
|
52
|
+
end
|
53
|
+
|
46
54
|
private
|
47
55
|
|
48
56
|
def assert_close(expected, actual)
|
@@ -43,6 +43,14 @@ module NationalGrid
|
|
43
43
|
assert_nil LatitudeLongitude.new(-45.878761, 170.502798).to_easting_northing
|
44
44
|
end
|
45
45
|
|
46
|
+
def test_round
|
47
|
+
point = LatitudeLongitude.new(12.3456, 78.9012, 34.5678).round(3)
|
48
|
+
|
49
|
+
assert_equal 12.346, point.latitude
|
50
|
+
assert_equal 78.901, point.longitude
|
51
|
+
assert_equal 34.568, point.elevation
|
52
|
+
end
|
53
|
+
|
46
54
|
private
|
47
55
|
|
48
56
|
def assert_close(expected, actual)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: national_grid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Haines
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- lib/national_grid/easting_northing.rb
|
114
114
|
- lib/national_grid/inspect.rb
|
115
115
|
- lib/national_grid/latitude_longitude.rb
|
116
|
+
- lib/national_grid/round.rb
|
116
117
|
- lib/national_grid/version.rb
|
117
118
|
- national_grid.gemspec
|
118
119
|
- test/national_grid/easting_northing_test.rb
|