marinetraffic 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/marinetraffic/version.rb +1 -1
- data/lib/marinetraffic/vessel.rb +26 -22
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f01e7fa9707d497da72d9ef6e12eb34d535fba5
|
4
|
+
data.tar.gz: 6b0c19cc2e002b3df7d665490807ab82b63eb158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14fd7b860b44c1e8d3c50e19623e256be04c567577f8e6ec592ece9d2053c61a97f2f3256aed42a73f438fc9c2344f533ec11afe15ca5aa32c19331599589089
|
7
|
+
data.tar.gz: 745922760aec1ac8e7bbd79045125dbd031294e657a66aa9a85172182060b2ad074f6a5fc8ef7c14c5a20bbc57de78564be33d25ab86a748911b90a66817f4a9
|
data/lib/marinetraffic/vessel.rb
CHANGED
@@ -34,8 +34,12 @@ module Marinetraffic
|
|
34
34
|
params = { mmsi: mmsi, timespan: 20 }.merge(options)
|
35
35
|
params[:msgtype] = :extended if extended
|
36
36
|
response = API.call(:exportvessel, params)
|
37
|
-
|
38
|
-
|
37
|
+
result = response.xpath("//row")[0]
|
38
|
+
|
39
|
+
if result != nil
|
40
|
+
attributes = map_attributes(response.xpath("//row")[0], extended)
|
41
|
+
new(attributes)
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
def self.map_attributes(response, extended)
|
@@ -105,32 +109,32 @@ module Marinetraffic
|
|
105
109
|
'AIS-SART (active), MOB-AIS, EPIRB-AIS'
|
106
110
|
when 15
|
107
111
|
'undefined = default (also used by AIS-SART, MOB-AIS and EPIRB-AIS under test)'
|
108
|
-
|
112
|
+
end
|
109
113
|
end
|
110
114
|
|
111
115
|
# http://help.marinetraffic.com/hc/en-us/articles/205579997-What-is-the-significance-of-the-AIS-SHIPTYPE-number-
|
112
116
|
def ship_type_human
|
113
117
|
return if ship_type == nil
|
114
118
|
case ship_type / 10
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
end
|
119
|
+
when 1
|
120
|
+
'Reserved'
|
121
|
+
when 2
|
122
|
+
'Wing In Ground'
|
123
|
+
when 3
|
124
|
+
'Special Category'
|
125
|
+
when 4
|
126
|
+
'High-Speed Craft'
|
127
|
+
when 5
|
128
|
+
'Special Category'
|
129
|
+
when 6
|
130
|
+
'Passenger'
|
131
|
+
when 7
|
132
|
+
'Cargo'
|
133
|
+
when 8
|
134
|
+
'Tanker'
|
135
|
+
when 9
|
136
|
+
'Other'
|
134
137
|
end
|
138
|
+
end
|
135
139
|
end
|
136
140
|
end
|