Class: MetricaApi::Response
- Inherits:
-
Object
- Object
- MetricaApi::Response
- Defined in:
- lib/metrica_api/response.rb
Overview
Yandex Metrica response parser
Class Method Summary collapse
Class Method Details
.parse(response) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/metrica_api/response.rb', line 7 def self.parse(response) if response.is_a?(Array) response.map { |r| parse(r) } elsif response.is_a?(String) JSON.parse(response) else response end rescue JSON::ParserError response end |