Class: Onebusaway::Agency
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Methods inherited from Base
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
112 113 114 |
# File 'lib/onebusaway.rb', line 112 def id @id end |
#lang ⇒ Object
Returns the value of attribute lang.
112 113 114 |
# File 'lib/onebusaway.rb', line 112 def lang @lang end |
#name ⇒ Object
Returns the value of attribute name.
112 113 114 |
# File 'lib/onebusaway.rb', line 112 def name @name end |
#phone ⇒ Object
Returns the value of attribute phone.
112 113 114 |
# File 'lib/onebusaway.rb', line 112 def phone @phone end |
#timezone ⇒ Object
Returns the value of attribute timezone.
112 113 114 |
# File 'lib/onebusaway.rb', line 112 def timezone @timezone end |
#url ⇒ Object
Returns the value of attribute url.
112 113 114 |
# File 'lib/onebusaway.rb', line 112 def url @url end |
Class Method Details
.parse(data) ⇒ Object
113 114 115 116 117 118 119 120 |
# File 'lib/onebusaway.rb', line 113 def self.parse(data) agency = self.new [:id, :name, :url, :timezone, :lang, :phone].each do |attr| value = data.elements[attr.to_s] agency.send("#{attr}=", value.text) if value end agency end |