Class: Nextbus::Stop
- Inherits:
-
Object
- Object
- Nextbus::Stop
- Includes:
- AttrWithDefault, InstantiateWithAttrs
- Defined in:
- lib/nextbus/stop.rb
Class Method Summary collapse
- .all(agency_id, route_id, direction_id) ⇒ Object
- .find(agency_id, route_id, direction_id, id) ⇒ Object
Methods included from AttrWithDefault
Methods included from InstantiateWithAttrs
Class Method Details
.all(agency_id, route_id, direction_id) ⇒ Object
9 10 11 |
# File 'lib/nextbus/stop.rb', line 9 def self.all(agency_id, route_id, direction_id) Nextbus.client.stops(agency_id, route_id, direction_id).map{|stop| new(stop) } end |
.find(agency_id, route_id, direction_id, id) ⇒ Object
13 14 15 |
# File 'lib/nextbus/stop.rb', line 13 def self.find(agency_id, route_id, direction_id, id) all(agency_id, route_id, direction_id).detect{|stop| stop.tag == id } end |