module Gurunavi::Photos
Public Instance Methods
map_photos_from_response(res)
click to toggle source
therefore convert response for photos, it means convert response to that: [
{photo hashie}, ...
]
# File lib/gurunavi/photos.rb, line 51 def map_photos_from_response(res) index = 0 photos = Hashie::Array.new while res.include?(index.to_s) photos.push(res[index.to_s].photo) index += 1 end photos end
photo_search(options={})
click to toggle source
Ref: api.gnavi.co.jp/api/manual/photosearch/
# File lib/gurunavi/photos.rb, line 5 def photo_search(options={}) response = connection.get do |req| req.url "PhotoSearchAPI/#{@api_version}", options end # if error happens, raise APIError from return_error_or_body function. body = return_error_or_body(response, response.body.response) map_photos_from_response(body) end