class Nhtsa::ChildSafetySeatInspectionStationLocator::GetByGeoLocation

Public Class Methods

new(latitude, longitude, radius) click to toggle source
# File lib/nhtsa/child_safety_seat_inspection_station_locator/get_by_geo_location.rb, line 4
def initialize(latitude, longitude, radius)
  @latitude = latitude
  @longitude = longitude
  @radius = radius
end

Public Instance Methods

inspection_stations() click to toggle source
# File lib/nhtsa/child_safety_seat_inspection_station_locator/get_by_geo_location.rb, line 14
def inspection_stations
  JSON.parse(open(url).read)["Results"]
end
url() click to toggle source
# File lib/nhtsa/child_safety_seat_inspection_station_locator/get_by_geo_location.rb, line 10
def url
  "#{BASE_URI}#{END_POINT}?lat=#{@latitude}&long=#{@longitude}&miles=#{@radius}&format=json"
end