google_analytics_v4_api 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7050078fae7248eeb571242439f9042faddf4c258c672aad42d0ce684f10e35
4
- data.tar.gz: cf1eee223ddc9a858860ba6c2ce384126faf40f37b404551f45741c17759bde5
3
+ metadata.gz: f939a19b1f843a3625fe45ec5757b2dc885707688a0ca2ce7ff57ca62b3cf9e8
4
+ data.tar.gz: cfc31ecdd79cd9f616dc48c0139eac1040763735f94048c1c0aed7c92026dfeb
5
5
  SHA512:
6
- metadata.gz: 57d08ee5e5e68e234add0875817118b0bdeae43949ee79a7cb3d7b31c828e90ba995a58a2bce8521728dad2a151a1be5e0bcc882988ea4bbffd6f8852804521a
7
- data.tar.gz: 79b280644dcf3726917a8cce147d5ea6e048a3e16deab043264f17cbcfe566646dfd0c7047b65e8d21f5384058b473f8e20ccb5b91dad3d766188bf65badeefe
6
+ metadata.gz: 7519de350d2412c58fd9fc8cbf3824fa632e88e4f3b4a6a02c737635528a574011b22a232ca818e1f9b14f3d2b16192e8823709faf4fd28a706e2c7b85cfcf30
7
+ data.tar.gz: b8b40cf733abab51e28771206f7eb11fe9001366b45a28ec6831ae7a981eb31fec22b2c86b503b1cdd2068c3de21d611c80169c96b14d08cea091587c210202c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- google_analytics_v4_api (0.0.5)
4
+ google_analytics_v4_api (0.0.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -22,7 +22,10 @@ module GoogleAnalyticsV4Api
22
22
  end
23
23
 
24
24
  def self.parse_list(client, body)
25
- JSON.parse(body)["accounts"].map do |attrs|
25
+ parsed_body = JSON.parse(body)
26
+ return [] if parsed_body["accounts"].nil?
27
+
28
+ parsed_body["accounts"].map do |attrs|
26
29
  GoogleAnalyticsV4Api::Account.new(client, attrs)
27
30
  end
28
31
  end
@@ -23,7 +23,10 @@ module GoogleAnalyticsV4Api
23
23
  end
24
24
 
25
25
  def self.parse_list(client, body)
26
- JSON.parse(body)["properties"].map do |attrs|
26
+ parsed_body = JSON.parse(body)
27
+ return [] if parsed_body["properties"].nil?
28
+
29
+ parsed_body["properties"].map do |attrs|
27
30
  GoogleAnalyticsV4Api::Property.new(client, attrs)
28
31
  end
29
32
  end
@@ -10,8 +10,8 @@ module GoogleAnalyticsV4Api
10
10
 
11
11
  def initialize(body)
12
12
  @body = JSON.parse body
13
- @raw_dimension_headers = @body["dimensionHeaders"]
14
- @raw_metric_headers = @body["metricHeaders"]
13
+ @raw_dimension_headers = @body["dimensionHeaders"] || []
14
+ @raw_metric_headers = @body["metricHeaders"] || []
15
15
  @rows = @body["rows"] || []
16
16
  @row_cont = @body["rowCount"] || 0
17
17
  @metadata = @body["metadata"]
@@ -1,3 +1,3 @@
1
1
  module GoogleAnalyticsV4Api
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_analytics_v4_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A very humble wrapper for the Google Analytics V4 API to be used in conjuntion
14
14
  with OAuth2