pius-wmata-hotfix 0.2.0.1 → 0.2.0.2
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.
- data/lib/resources/line.rb +7 -7
- data/lib/resources/station.rb +2 -2
- data/wmata.gemspec +2 -2
- metadata +2 -2
data/lib/resources/line.rb
CHANGED
|
@@ -33,6 +33,13 @@ module WMATA
|
|
|
33
33
|
def symbol_to_line_code(symbol)
|
|
34
34
|
SYMBOL_TO_LINES_MAP[symbol]
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
# Get a specific line, identified by line code (e.g., "RD") or a +Symbol+
|
|
38
|
+
# string name (e.g., +:red+).
|
|
39
|
+
def get(code)
|
|
40
|
+
code = Line.symbol_to_line_code(code) if code.is_a?(Symbol)
|
|
41
|
+
get_all.select {|l| l.code == code}.pop
|
|
42
|
+
end
|
|
36
43
|
end
|
|
37
44
|
|
|
38
45
|
# Get the first station on this line.
|
|
@@ -67,13 +74,6 @@ module WMATA
|
|
|
67
74
|
|
|
68
75
|
alias_method :stations, :route
|
|
69
76
|
|
|
70
|
-
# Get a specific line, identified by line code (e.g., "RD") or a +Symbol+
|
|
71
|
-
# string name (e.g., +:red+).
|
|
72
|
-
def get(code)
|
|
73
|
-
code = Line.symbol_to_line_code(code) if code.is_a?(Symbol)
|
|
74
|
-
get_all.select {|l| l.code == code}.pop
|
|
75
|
-
end
|
|
76
|
-
|
|
77
77
|
# Returns the line's code (also available as +line_code+).
|
|
78
78
|
def code
|
|
79
79
|
@attrs['LineCode']
|
data/lib/resources/station.rb
CHANGED
|
@@ -29,12 +29,12 @@ module WMATA
|
|
|
29
29
|
# Get all possible codes for this station (some stations are in together with another so
|
|
30
30
|
# they are technically identified by two station codes).
|
|
31
31
|
def codes
|
|
32
|
-
[@attrs['Code'], @attrs['StationTogether1'], @attrs['StationTogether2']].compact
|
|
32
|
+
[@attrs['Code'], @attrs['StationTogether1'], @attrs['StationTogether2']].compact.delete_if {|c| c == ''}
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# Get the line codes for this station (some stations serve more than one line).
|
|
36
36
|
def line_codes
|
|
37
|
-
[@attrs['LineCode1'], @attrs['LineCode2'], @attrs['LineCode3'], @attrs['LineCode4']].compact
|
|
37
|
+
[@attrs['LineCode1'], @attrs['LineCode2'], @attrs['LineCode3'], @attrs['LineCode4']].compact.delete_if {|c| c == ''}
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
# Get +Line+ instances for the lines serviced by this station.
|
data/wmata.gemspec
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
|
-
s.name = %q{
|
|
7
|
+
s.name = %q{wmata}
|
|
8
8
|
s.version = "0.2.0"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
|
|
|
44
44
|
"test/test_wmata.rb",
|
|
45
45
|
"wmata.gemspec"
|
|
46
46
|
]
|
|
47
|
-
s.homepage = %q{http://github.com/
|
|
47
|
+
s.homepage = %q{http://github.com/intridea/wmata}
|
|
48
48
|
s.rdoc_options = ["--charset=UTF-8"]
|
|
49
49
|
s.require_paths = ["lib"]
|
|
50
50
|
s.rubygems_version = %q{1.3.6}
|