Class: Bort::Route::Info
- Inherits:
-
Object
- Object
- Bort::Route::Info
- Defined in:
- lib/bort/route.rb
Instance Attribute Summary collapse
-
#abbreviation ⇒ Object
Returns the value of attribute abbreviation.
-
#color ⇒ Object
Returns the value of attribute color.
-
#date ⇒ Object
Returns the value of attribute date.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#holidays ⇒ Object
Returns the value of attribute holidays.
-
#name ⇒ Object
Returns the value of attribute name.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#route_id ⇒ Object
Returns the value of attribute route_id.
-
#route_number ⇒ Object
Returns the value of attribute route_number.
-
#schedule_number ⇒ Object
Returns the value of attribute schedule_number.
-
#stations ⇒ Object
Returns the value of attribute stations.
Instance Method Summary collapse
-
#initialize(number, options = {}) ⇒ Info
constructor
A new instance of Info.
Constructor Details
#initialize(number, options = {}) ⇒ Info
Returns a new instance of Info.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/bort/route.rb', line 69 def initialize(number, ={}) self.route_number = number () = { :action => 'route', :cmd => 'routeinfo', :route => route_number, } [:sched] = schedule_number [:date] = date xml = Util.download() data = Hpricot(xml) self.schedule_number = (data/:sched_num).inner_text self.name = (data/:route/:name).inner_text self.abbreviation = (data/:route/:abbr).inner_text self.route_number = (data/:route/:number).inner_text self.origin = (data/:route/:origin).inner_text self.destination = (data/:route/:destination).inner_text self.color = (data/:route/:color).inner_text self.holidays = (data/:route/:holidays).inner_text self.stations = (data/:route/:config/:station).map(&:inner_text) end |
Instance Attribute Details
#abbreviation ⇒ Object
Returns the value of attribute abbreviation.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def abbreviation @abbreviation end |
#color ⇒ Object
Returns the value of attribute color.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def color @color end |
#date ⇒ Object
Returns the value of attribute date.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def date @date end |
#destination ⇒ Object
Returns the value of attribute destination.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def destination @destination end |
#holidays ⇒ Object
Returns the value of attribute holidays.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def holidays @holidays end |
#name ⇒ Object
Returns the value of attribute name.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def name @name end |
#origin ⇒ Object
Returns the value of attribute origin.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def origin @origin end |
#route_id ⇒ Object
Returns the value of attribute route_id.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def route_id @route_id end |
#route_number ⇒ Object
Returns the value of attribute route_number.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def route_number @route_number end |
#schedule_number ⇒ Object
Returns the value of attribute schedule_number.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def schedule_number @schedule_number end |
#stations ⇒ Object
Returns the value of attribute stations.
66 67 68 |
# File 'lib/bort/route.rb', line 66 def stations @stations end |