class Bart::Client::Stops

Public Instance Methods

all()
Alias for: list
find(id)
Alias for: get
get(id) click to toggle source

Return the route whose id matches the given id

# File lib/bart_api/client/stops.rb, line 14
def get id
  parsed = get_request '/api/stn.aspx', query: { cmd: :stninfo, orig: id }
  Stop.new parsed['root']['stations']['station']
end
Also aliased as: find
list() click to toggle source

Return a list of all stops on the system.

# File lib/bart_api/client/stops.rb, line 6
def list
  parsed = get_request '/api/stn.aspx', query: { cmd: :stns }
  parsed['root']['stations']['station'].map { |stop| Stop.new stop }
end
Also aliased as: all