ratis 3.3.5 → 3.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,25 +20,11 @@ module Ratis
20
20
 
21
21
  return [] unless response.success?
22
22
 
23
- stops = response.to_hash[:closeststop_response][:stops][:stop].map do |arr|
24
- next if arr[:description].blank?
25
-
26
- stop = Ratis::Stop.new
27
- stop.walk_dist = arr[:walkdist]
28
- stop.description = arr[:description]
29
- stop.stop_id = arr[:stopid]
30
- stop.atis_stop_id = arr[:atisstopid]
31
- stop.latitude = arr[:lat]
32
- stop.longitude = arr[:long]
33
- stop.walk_dir = arr[:walkdir]
34
- stop.side = arr[:side]
35
- stop.heading = arr[:heading]
36
- stop.stop_position = arr[:stopposition]
37
- stop.route_dirs = arr[:routedirs]
38
- stop
23
+ stops = response.to_hash[:closeststop_response][:stops][:stop].map do |stop|
24
+ next if stop[:description].blank?
39
25
 
26
+ Ratis::Stop.new(stop)
40
27
  end.compact
41
-
42
28
  end
43
29
 
44
30
  end
data/lib/ratis/stop.rb CHANGED
@@ -1,11 +1,29 @@
1
-
2
1
  module Ratis
3
2
  class Stop
4
- attr_accessor :latitude, :longitude, :area, :walk_dir, :stop_position, :description, :route_dirs, :walk_dist, :side, :stop_id, :heading, :atis_stop_id
3
+ attr_accessor :latitude, :longitude, :area, :walk_dir, :stop_position, :description,
4
+ :route_dirs, :walk_dist, :side, :stop_id, :heading, :atis_stop_id
5
5
 
6
6
  alias_method :lat, :latitude
7
7
  alias_method :lng, :longitude
8
8
 
9
+ # :description=>"JEFFERSON STREET/1ST AVE LIGHT RAIL STN", :area=>"Phoenix", :stopid=>"10013", :atisstopid=>"10891",
10
+ # :lat=>"33.448188", :long=>"-112.075198", :walkdist=>"0.08", :walkdir=>"S", :stopposition=>"O", :heading=>"NB", :side=>"Far", :routedirs=>{:routedir=>"LTRL-E"}
11
+
12
+ def initialize(params)
13
+ @description = params[:description]
14
+ @area = params[:area]
15
+ @stop_id = params[:stopid]
16
+ @atis_stop_id = params[:atisstopid]
17
+ @latitude = params[:lat]
18
+ @longitude = params[:long]
19
+ @walk_dist = params[:walkdist]
20
+ @walk_dir = params[:walkdir]
21
+ @stop_position = params[:stopposition]
22
+ @heading = params[:heading]
23
+ @side = params[:side]
24
+ @route_dirs = params[:routedirs]
25
+ end
26
+
9
27
  def route_dir
10
28
  @route_dirs[:routedir]
11
29
  end
data/lib/ratis/version.rb CHANGED
@@ -5,7 +5,7 @@ module Ratis
5
5
  def version
6
6
  @version ||= begin
7
7
 
8
- string = '3.3.5'
8
+ string = '3.3.6'
9
9
 
10
10
  def string.parts
11
11
  split('.').map { |p| p.to_i }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratis
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
- - 5
10
- version: 3.3.5
9
+ - 6
10
+ version: 3.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Burst Software
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-12-17 00:00:00 Z
18
+ date: 2013-12-19 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: savon