lib/enceladus/requester.rb in enceladus-0.0.6 vs lib/enceladus/requester.rb in enceladus-0.0.7
- old
+ new
@@ -1,7 +1,7 @@
require 'rest_client'
-require 'ostruct'
+require 'hashugar'
class Enceladus::Requester
class << self
# Makes a get request to one of the TMDb API endpoints.
# Example:
@@ -68,10 +68,10 @@
end
def parse_response(response_body)
begin
Enceladus::Logger.log.info { "Response: #{JSON.pretty_generate(JSON.parse(response_body))}" }
- JSON.parse(response_body, object_class: OpenStruct)
+ JSON.parse(response_body).to_hashugar
rescue JSON::ParserError => e
raise Enceladus::Exception::JsonParseError.new("Response body could not be parsed: #{e.message}")
end
end
end
\ No newline at end of file