Class: Bort::Route::Routes
- Inherits:
-
Object
- Object
- Bort::Route::Routes
- Defined in:
- lib/bort/route.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#routes ⇒ Object
Returns the value of attribute routes.
-
#schedule ⇒ Object
Returns the value of attribute schedule.
-
#schedule_number ⇒ Object
Returns the value of attribute schedule_number.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Routes
constructor
A new instance of Routes.
Constructor Details
#initialize(options = {}) ⇒ Routes
Returns a new instance of Routes.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/bort/route.rb', line 36 def initialize(={}) () = { :action => 'route', :cmd => 'routes', } [:sched] = schedule [:date] = date xml = Util.download() data = Hpricot(xml) self.schedule_number = (data/:sched_num).inner_text self.routes = (data/:route).map do |route| Route.parse(route) end.sort end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
34 35 36 |
# File 'lib/bort/route.rb', line 34 def date @date end |
#routes ⇒ Object
Returns the value of attribute routes.
34 35 36 |
# File 'lib/bort/route.rb', line 34 def routes @routes end |
#schedule ⇒ Object
Returns the value of attribute schedule.
34 35 36 |
# File 'lib/bort/route.rb', line 34 def schedule @schedule end |
#schedule_number ⇒ Object
Returns the value of attribute schedule_number.
34 35 36 |
# File 'lib/bort/route.rb', line 34 def schedule_number @schedule_number end |