Method: Clickatell::Response.parse

Defined in:
lib/clickatell/response.rb

.parse(http_response) ⇒ Object

Returns the HTTP response body data as a hash.



12
13
14
15
16
17
# File 'lib/clickatell/response.rb', line 12

def parse(http_response)
  if http_response.body.scan(/ERR/).any?
    raise Clickatell::API::Error.parse(http_response.body)
  end
  YAML.load(http_response.body.scan(PARSE_REGEX).join("\n"))
end