pius-wmata-hotfix 0.2.0.1 → 0.2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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']
@@ -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.
@@ -4,7 +4,7 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{pius-wmata-hotfix}
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/jm/wmata}
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}
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 2
8
8
  - 0
9
- - 1
10
- version: 0.2.0.1
9
+ - 2
10
+ version: 0.2.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy McAnally