ratis 2.5.2.2 → 2.5.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ratis.rb CHANGED
@@ -10,17 +10,19 @@ require 'ratis/landmark_category'
10
10
  require 'ratis/location'
11
11
  require 'ratis/next_bus'
12
12
  require 'ratis/point_2_point'
13
- require 'ratis/point_2_point/standard_response'
14
13
  require 'ratis/point_2_point/group'
15
- require 'ratis/point_2_point/trip'
16
14
  require 'ratis/point_2_point/service'
15
+ require 'ratis/point_2_point/standard_response'
17
16
  require 'ratis/point_2_point/stop'
17
+ require 'ratis/point_2_point/trip'
18
18
  require 'ratis/request'
19
19
  require 'ratis/route'
20
20
  require 'ratis/route_stops'
21
21
  require 'ratis/route_stops/stop'
22
22
  require 'ratis/schedule_nearby'
23
23
  require 'ratis/timetable'
24
+ require 'ratis/timetable/stop'
25
+ require 'ratis/timetable/trip'
24
26
  require 'ratis/walk'
25
27
 
26
28
  module Ratis
@@ -2,7 +2,7 @@ module Ratis
2
2
 
3
3
  class Timetable
4
4
 
5
- attr_accessor :route_short_name, :direction, :service_type, :operator, :effective
5
+ attr_accessor :route_short_name, :direction, :service_type, :operator, :effective, :timepoints, :trips
6
6
 
7
7
  def self.where(conditions)
8
8
  short_name = conditions.delete :route_short_name
@@ -28,6 +28,8 @@ module Ratis
28
28
  timetable.service_type = headway[:servicetype]
29
29
  timetable.operator = headway[:operator]
30
30
  timetable.effective = headway[:effective]
31
+ timetable.timepoints = headway[:timepoints][:stop].collect{|tp| Timetable::Stop.new(tp[:atisstopid], tp[:stopid], tp[:description], tp[:area])}
32
+ timetable.trips = headway[:times][:trip].collect{|t| Timetable::Trip.new(t[:time], t[:comment])}
31
33
  timetable
32
34
  end
33
35
 
@@ -0,0 +1,4 @@
1
+ module Ratis
2
+ class Timetable::Stop < Struct.new(:atis_stop_id, :stop_id, :description, :area)
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Ratis
2
+ class Timetable::Trip < Struct.new(:times, :comment)
3
+ end
4
+ end
data/lib/ratis/version.rb CHANGED
@@ -4,7 +4,7 @@ module Ratis
4
4
 
5
5
  def version
6
6
  @version ||= begin
7
- string = '2.5.2.2'
7
+ string = '2.5.2.4'
8
8
 
9
9
  def string.parts
10
10
  split('.').map { |p| p.to_i }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratis
3
3
  version: !ruby/object:Gem::Version
4
- hash: 75
4
+ hash: 71
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 5
9
9
  - 2
10
- - 2
11
- version: 2.5.2.2
10
+ - 4
11
+ version: 2.5.2.4
12
12
  platform: ruby
13
13
  authors:
14
14
  - AuthorityLabs
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-08-16 00:00:00 Z
19
+ date: 2012-10-26 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: savon
@@ -175,6 +175,8 @@ files:
175
175
  - lib/ratis/route_stops/stop.rb
176
176
  - lib/ratis/route_stops.rb
177
177
  - lib/ratis/schedule_nearby.rb
178
+ - lib/ratis/timetable/stop.rb
179
+ - lib/ratis/timetable/trip.rb
178
180
  - lib/ratis/timetable.rb
179
181
  - lib/ratis/version.rb
180
182
  - lib/ratis/walk.rb