Class: Bort::Route::Route
- Inherits:
-
Object
- Object
- Bort::Route::Route
- 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.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#route_id ⇒ Object
Returns the value of attribute route_id.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#abbreviation ⇒ Object
Returns the value of attribute abbreviation.
4 5 6 |
# File 'lib/bort/route.rb', line 4 def abbreviation @abbreviation end |
#color ⇒ Object
Returns the value of attribute color.
4 5 6 |
# File 'lib/bort/route.rb', line 4 def color @color end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/bort/route.rb', line 4 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/bort/route.rb', line 4 def number @number end |
#route_id ⇒ Object
Returns the value of attribute route_id.
4 5 6 |
# File 'lib/bort/route.rb', line 4 def route_id @route_id end |
Class Method Details
.parse(doc) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/bort/route.rb', line 5 def self.parse(doc) route = Route.new route.name = (doc/:name).inner_text route.abbreviation = (doc/:abbr).inner_text route.route_id = (doc/:routeid).inner_text route.number = (doc/:number).inner_text.to_i route.color = (doc/:color).inner_text route end |
Instance Method Details
#<=>(other) ⇒ Object
24 25 26 |
# File 'lib/bort/route.rb', line 24 def <=> other self.number <=> other.number end |
#info(options = {}) ⇒ Object
16 17 18 |
# File 'lib/bort/route.rb', line 16 def info(={}) Info.new(number, ) end |
#schedule(options = {}) ⇒ Object
20 21 22 |
# File 'lib/bort/route.rb', line 20 def schedule(={}) Schedule::RouteSchedule.new(number, ) end |