class Iupick::Waypoints

This is the class object for the waypoints.

Public Class Methods

get_postal_code_waypoints(postal_code) click to toggle source

This method allows you to pull the full information for waypoints in a certain postal code

# File lib/iupick/waypoint.rb, line 37
def self.get_postal_code_waypoints(postal_code)
  url = Iupick.get_base_url() + 'waypoints/postal-ids/' + postal_code.to_s + '/'
  headers = Iupick.generate_headers(auth='public')

  response = Unirest.get url,
    headers: headers

  decoded_response = response.body
  return decoded_response
end
get_waypoint_information(waypoint_id) click to toggle source

This method pulls the complete information for a single waypoint.

# File lib/iupick/waypoint.rb, line 6
def self.get_waypoint_information(waypoint_id)
  if waypoint_id
    url = Iupick.get_base_url() + 'waypoints/' + waypoint_id.to_s + '/'
    headers = Iupick.generate_headers(auth = 'public')

    response = Unirest.get url,
      headers: headers
    decoded_response = response.body
    return decoded_response
  else
    return {
      'error': 'No es posible obtener la informacion del punto ' + waypoint_id.to_s
    }
  end
end
get_waypoints_lite() click to toggle source

This method allows you to pull the basic information required to plot the waypoints in a map

# File lib/iupick/waypoint.rb, line 24
def self.get_waypoints_lite()
  url = Iupick.get_base_url() + 'waypoints/lite/'
  headers = Iupick.generate_headers(auth = 'public')

  response = Unirest.get url,
    headers: headers

  decoded_response = response.body
  return decoded_response
end