# Get request will look like:
# http://domain.or.ip/api/status_of?coordinates=detailed
}) do |data, resolve, command|
check_response(data) do |resp|
# Update status (made available to interfaces)
self[:position] = resp['coords']
# (might have been 500 or 404, depends on what you are expecting)
# We're assuming a JSON response and we are passing that data
# back to the calling function and assuming success at this point
yield ::JSON.parse(data.body) if block_given?
# Fail if there are any issues
# Obviously this behaviour depends on the service etc