Class: SFBATransitAPI::Agency
- Inherits:
-
Object
- Object
- SFBATransitAPI::Agency
- Defined in:
- lib/sfba_transit_api/agency.rb
Instance Attribute Summary collapse
-
#has_direction ⇒ Object
Returns the value of attribute has_direction.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#name ⇒ Object
Returns the value of attribute name.
-
#routes ⇒ Object
Returns the value of attribute routes.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#has_direction ⇒ Object
Returns the value of attribute has_direction.
3 4 5 |
# File 'lib/sfba_transit_api/agency.rb', line 3 def has_direction @has_direction end |
#mode ⇒ Object
Returns the value of attribute mode.
3 4 5 |
# File 'lib/sfba_transit_api/agency.rb', line 3 def mode @mode end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/sfba_transit_api/agency.rb', line 3 def name @name end |
#routes ⇒ Object
Returns the value of attribute routes.
3 4 5 |
# File 'lib/sfba_transit_api/agency.rb', line 3 def routes @routes end |
Class Method Details
.parse(node) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sfba_transit_api/agency.rb', line 17 def self.parse(node) node.xpath("//Agency").map do |agency_node| agency = new agency.name = agency_node["Name"] agency.has_direction = agency_node["HasDirection"] agency.mode = agency_node["Mode"] agency.routes = Route.parse(agency_node, agency) agency end end |
Instance Method Details
#to_s ⇒ Object
5 6 7 |
# File 'lib/sfba_transit_api/agency.rb', line 5 def to_s "#<SFBATransitAPI::Agency:#{object_id} @name=\"#{name}\", @has_direction=#{has_direction}, @mode=\"#{mode}\", routes.count=#{routes.count}>" end |