lib/gotransverse-tract-api.rb in gotransverse-tract-api-0.2.2 vs lib/gotransverse-tract-api.rb in gotransverse-tract-api-0.2.3
- old
+ new
@@ -126,11 +126,10 @@
# @param {Hash} api_params (optional)
#
def self.get_response_for(klass, api_params={})
api_url = GoTransverseTractApi.get_api_url_for(klass)
-
pp "api_url: " + api_url
if GoTransverseTractApi.configuration.cache_enabled
return self.get_cached_response_from(klass, api_params)
end
@@ -214,9 +213,11 @@
klass = klass.to_s.split("::").last
hsh = Hash.from_xml(xml_response.to_s)
hsh = hsh[klass.pluralize.camelize(:lower)][klass.camelize(:lower)] rescue Hash.from_xml(xml_response.to_s)[klass.camelize(:lower)]
return hsh
+ rescue
+ {}
end
#
# self.camelize_keys
#