Sha256: 5b1af4f10334c6dff2e95539eb1695db49b2f3545a0a7bcdc56fdf7e66e5870a
Contents?: true
Size: 475 Bytes
Versions: 3
Compression:
Stored size: 475 Bytes
Contents
module GmapsTz class ResponseParser def initialize(uri, response) @uri @response = response end def execute json = parse_json if json["status"] == "OK" json else raise Error.from_json(@uri, json) end end private def parse_json begin JSON.parse(@response.body) rescue JSON::ParserError raise InvalidResponseBodyError.new(@uri, @response) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gmaps_tz-0.0.4 | lib/gmaps_tz/response_parser.rb |
gmaps_tz-0.0.3 | lib/gmaps_tz/response_parser.rb |
gmaps_tz-0.0.2 | lib/gmaps_tz/response_parser.rb |