nmea_parser 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/nmea_parser.rb +8 -8
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1be9d4a828a3163104e7f00a64ea11bb28e752aa
|
4
|
+
data.tar.gz: 6a9d13aaff04e863ca89461bb5c69617404c76a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86316fa84dff6999d4e299d9998322f0438b17a7ed40165d26c2c66f4ccb9b4ec9b4a92315fc3b3137b7f844c32aa30a896c958b0d06bd409c1b1a0e6ec89cc0
|
7
|
+
data.tar.gz: 7460b251b0f9a6fce2ecdaf6557b433b46fada649ae6a7b9ebf3ec47a68bd4f8cc8887e1b9bc7a28747c22c32db3cd8807a657b003d864ae8764919750e5d95c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/nmea_parser.rb
CHANGED
@@ -9,16 +9,10 @@ class NMEAParser
|
|
9
9
|
|
10
10
|
attr_reader :longitude, :latitude, :time
|
11
11
|
|
12
|
-
def initialize(s)
|
13
|
-
parse(s)
|
12
|
+
def initialize(s=nil)
|
13
|
+
parse(s) if s
|
14
14
|
end
|
15
15
|
|
16
|
-
def to_h()
|
17
|
-
{time: @time, latitude: @latitude, longitude: @longitude}
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
16
|
def parse(raw_line)
|
23
17
|
|
24
18
|
msgcode = raw_line[/^\$GP(\w+)/]
|
@@ -35,6 +29,12 @@ class NMEAParser
|
|
35
29
|
|
36
30
|
end
|
37
31
|
|
32
|
+
def to_h()
|
33
|
+
{time: @time, latitude: @latitude, longitude: @longitude}
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
38
|
def decimalize(raw_x, raw_nesw)
|
39
39
|
|
40
40
|
nesw = {n: :+, e: :+, s: :-, w: :-}
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|