jp_station 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jp_station/simpleapi.rb +15 -11
- data/lib/jp_station/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bd429909067737bf6a076bb45e898c71997beef
|
4
|
+
data.tar.gz: 62844d92dd81316ae74cd80b5a9988be13d1bbe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b92c6b6fce0aea305f49abf475b5d7932bca8bdf11cd5e16e65ca4f052f13cdbad16f2028810cec58504cc152a5e9205b35b2e2c3b5e972e079a866f8a095507
|
7
|
+
data.tar.gz: 1be9768510b36a16dca53f6822bfbfab607acba97b19d980574566b643754d0b383ed98ff719e3c1b6f9266185e7dfa52295c00af2ec8e42c5d5f4f5904358a1
|
data/lib/jp_station/simpleapi.rb
CHANGED
@@ -30,19 +30,23 @@ module JpStation
|
|
30
30
|
|
31
31
|
def station_hash(station)
|
32
32
|
{
|
33
|
-
:name => station.elements["name"]
|
34
|
-
:furigana => station.elements["furigana"]
|
35
|
-
:line => station.elements["line"]
|
36
|
-
:city => station.elements["city"]
|
37
|
-
:prefecture => station.elements["prefecture"]
|
38
|
-
:direction => station.elements["direction"]
|
39
|
-
:directionReverse => station.elements["directionReverse"]
|
40
|
-
:distance => station.elements["distance"]
|
41
|
-
:distanceM => station.elements["distanceM"]
|
42
|
-
:distanceKm => station.elements["distanceKm"]
|
43
|
-
:traveltime => station.elements["traveltime"]
|
33
|
+
:name => blank_if_nil( station.elements["name"] ),
|
34
|
+
:furigana => blank_if_nil( station.elements["furigana"] ),
|
35
|
+
:line => blank_if_nil( station.elements["line"] ),
|
36
|
+
:city => blank_if_nil( station.elements["city"] ),
|
37
|
+
:prefecture => blank_if_nil( station.elements["prefecture"] ),
|
38
|
+
:direction => blank_if_nil( station.elements["direction"] ),
|
39
|
+
:directionReverse => blank_if_nil( station.elements["directionReverse"] ),
|
40
|
+
:distance => blank_if_nil( station.elements["distance"] ),
|
41
|
+
:distanceM => blank_if_nil( station.elements["distanceM"] ),
|
42
|
+
:distanceKm => blank_if_nil( station.elements["distanceKm"] ),
|
43
|
+
:traveltime => blank_if_nil( station.elements["traveltime"] )
|
44
44
|
}
|
45
45
|
end
|
46
|
+
|
47
|
+
def blank_if_nil(element)
|
48
|
+
element ? element.text : ""
|
49
|
+
end
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
data/lib/jp_station/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jp_station
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takayoshi Nishida
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|