module Frizzle
  class Vehicles < Base
    class << self

      def find(options={})
        fetch("/vehicles.json",
          :query => options )
      end

      def find_by_agencies(agencies)
        fetch("/vehicles.json",
          :query => { :agencies => formatted_list(agencies) })
      end

      def find_by_agencies_and_routes(agencies, routes)
        fetch("/vehicles.json",
          :query => {
            :agencies => formatted_list(agencies),
            :routes => formatted_list(routes)
          })
      end

      def find_by_agencies_and_geo_area(agencies, geo_area_first, geo_area_second=nil)
        fetch("/vehicles.json",
          :query => {
            :agencies => formatted_list(agencies),
            :geo_area => formatted_geo_area(geo_area_first, geo_area_second)
          })
      end

      def find_by_agencies_and_routes_and_geo_area(agencies, routes, geo_area_first, geo_area_second=nil)
        fetch("/vehicles.json",
            :query => {
              :agencies => formatted_list(agencies),
              :routes => formatted_list(routes),
              :geo_area => formatted_geo_area(geo_area_first, geo_area_second)
          })
      end

    end
  end
end