module JunglePath::API::Helpers::Result

Public Instance Methods

handle_result(item) click to toggle source
# File lib/jungle_path/api/helpers/result.rb, line 7
def handle_result(item)
        # handles the api result (converts to json).
        halt 404 unless item
        return JunglePath::Json.dump item if item.class == Array or item.class == Hash
        return item.to_json if item
end