Class: Onebusaway::Route

Inherits:
Base
  • Object
show all
Defined in:
lib/onebusaway.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

from_xml

Instance Attribute Details

#agencyObject

Returns the value of attribute agency.



153
154
155
# File 'lib/onebusaway.rb', line 153

def agency
  @agency
end

#descriptionObject

Returns the value of attribute description.



153
154
155
# File 'lib/onebusaway.rb', line 153

def description
  @description
end

#idObject

Returns the value of attribute id.



153
154
155
# File 'lib/onebusaway.rb', line 153

def id
  @id
end

#longNameObject

Returns the value of attribute longName.



153
154
155
# File 'lib/onebusaway.rb', line 153

def longName
  @longName
end

#shortNameObject

Returns the value of attribute shortName.



153
154
155
# File 'lib/onebusaway.rb', line 153

def shortName
  @shortName
end

#typeObject

Returns the value of attribute type.



153
154
155
# File 'lib/onebusaway.rb', line 153

def type
  @type
end

#urlObject

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