Class: Onebusaway::Route
Instance Attribute Summary collapse
-
#agency ⇒ Object
Returns the value of attribute agency.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#longName ⇒ Object
Returns the value of attribute longName.
-
#shortName ⇒ Object
Returns the value of attribute shortName.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Methods inherited from Base
Instance Attribute Details
#agency ⇒ Object
Returns the value of attribute agency.
153 154 155 |
# File 'lib/onebusaway.rb', line 153 def agency @agency end |
#description ⇒ Object
Returns the value of attribute description.
153 154 155 |
# File 'lib/onebusaway.rb', line 153 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
153 154 155 |
# File 'lib/onebusaway.rb', line 153 def id @id end |
#longName ⇒ Object
Returns the value of attribute longName.
153 154 155 |
# File 'lib/onebusaway.rb', line 153 def longName @longName end |
#shortName ⇒ Object
Returns the value of attribute shortName.
153 154 155 |
# File 'lib/onebusaway.rb', line 153 def shortName @shortName end |
#type ⇒ Object
Returns the value of attribute type.
153 154 155 |
# File 'lib/onebusaway.rb', line 153 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
153 154 155 |
# File 'lib/onebusaway.rb', line 153 def url @url end |
Class Method Details
.parse(data) ⇒ Object
154 155 156 157 158 159 160 161 162 |
# File 'lib/onebusaway.rb', line 154 def self.parse(data) route = self.new [:id, :shortName, :longName, :description, :type, :url].each do |attr| value = data.elements[attr.to_s] route.send("#{attr}=", value.text) if value end route.agency = Agency.parse(data.elements["agency"]) route end |