Class: Bort::Schedule::Fare
- Inherits:
-
Object
- Object
- Bort::Schedule::Fare
- Defined in:
- lib/bort/schedule.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#fare ⇒ Object
Returns the value of attribute fare.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#schedule_number ⇒ Object
Returns the value of attribute schedule_number.
Instance Method Summary collapse
-
#initialize(orig, dest, options = {}) ⇒ Fare
constructor
A new instance of Fare.
Constructor Details
#initialize(orig, dest, options = {}) ⇒ Fare
Returns a new instance of Fare.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/bort/schedule.rb', line 110 def initialize(orig, dest, ={}) self.origin = orig self.destination = dest () = { :action => 'sched', :cmd => 'fare', :orig => origin, :dest => destination, :date => date, :sched => schedule_number, } xml = Util.download() data = Hpricot(xml) self.schedule_number = (data/:sched_num).inner_text.to_i self.fare = (data/:fare).inner_text.to_f end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
108 109 110 |
# File 'lib/bort/schedule.rb', line 108 def date @date end |
#destination ⇒ Object
Returns the value of attribute destination.
108 109 110 |
# File 'lib/bort/schedule.rb', line 108 def destination @destination end |
#fare ⇒ Object
Returns the value of attribute fare.
108 109 110 |
# File 'lib/bort/schedule.rb', line 108 def fare @fare end |
#origin ⇒ Object
Returns the value of attribute origin.
108 109 110 |
# File 'lib/bort/schedule.rb', line 108 def origin @origin end |
#schedule_number ⇒ Object
Returns the value of attribute schedule_number.
108 109 110 |
# File 'lib/bort/schedule.rb', line 108 def schedule_number @schedule_number end |