Class: GmapsTz::ResponseParser

Inherits:
Object
  • Object
show all
Defined in:
lib/gmaps_tz/response_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri, response) ⇒ ResponseParser

Returns a new instance of ResponseParser.



3
4
5
6
# File 'lib/gmaps_tz/response_parser.rb', line 3

def initialize(uri, response)
  @uri
  @response = response
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
# File 'lib/gmaps_tz/response_parser.rb', line 8

def execute
  json = parse_json

  if json["status"] == "OK"
    json
  else
    raise Error.from_json(@uri, json)
  end
end