hisui 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40023cc074221349d9cad623cd2caaac5e2ffb88e67034898369f66b7fc816c9
4
- data.tar.gz: 25adc10ab95a55e827019fc7dcb602b526c2c9a294dc6cc5e14df44cd4ac079e
3
+ metadata.gz: b39bcdc510844184ee5b7115e3c5993498d596b022902ca9af4b7ad045847082
4
+ data.tar.gz: '094b0cfe1131f880dc85f65e555aa47f1b343e90927ee3b1e71ebbbce500b717'
5
5
  SHA512:
6
- metadata.gz: ac21d837a1d1fbe96652c678e5152ec07678c89a941c31b128268bc875e4121af60ae11abe33f7746ee380a46c846df20f10cc2a5649bcc591e4fa4d4af03539
7
- data.tar.gz: f9d20bf6242ee9da3033e52173b9ed7348ef20cdcf0f7906107a09ae4f2b31c5d0116dec8e3741e7572cb803677a9296897c6f0b799690b2a53f91d7533ed93c
6
+ metadata.gz: 8ccfbdb73e5904d98d776737c274a4195b83bbc118fe35fca914e09b47506d0aceeafedc99e08ecc468256310cf515c5fc0ec969c3e1052ffdad8ec5e413e634
7
+ data.tar.gz: 88c3098046b9dec4896f84702dc79ec9746a58188dab2a97be1ac2183c8b54fd4a4af438de18a3d0c4c13faf0db21cef56ef04620d0a35f50ac34e1e80968dea
data/README.md CHANGED
@@ -44,9 +44,9 @@ end
44
44
 
45
45
  3. Get Google Analytics API response with `results` methods.
46
46
  Set `start_date` and `end_date` if you need.(defult period is past one month)
47
- Set `compare_start_date` and `compare_end_date` if you need.
47
+ Set `comparing_start_date` and `comparing_end_date` if you need.
48
48
  ```ruby
49
- response = DailySummary.results(profile: profile, start_date: Date.current - 7.days, end_date: Date.current, compare_start_date: Date.current - 7.days - 1.month, compare_end_date: Date.current - 1.month)
49
+ response = DailySummary.results(profile: profile, start_date: Date.current - 7.days, end_date: Date.current, comparing_start_date: Date.current - 7.days - 1.month, comparing_end_date: Date.current - 1.month)
50
50
  ```
51
51
 
52
52
  4. Use data.
@@ -15,7 +15,7 @@ module Hisui
15
15
  @primary ||= begin
16
16
  primary = []
17
17
 
18
- data.rows.each do |row|
18
+ data.try(:rows).try(:each) do |row|
19
19
  row_data = []
20
20
  row.dimensions.each do |dimension|
21
21
  row_data << dimension
@@ -36,16 +36,14 @@ module Hisui
36
36
  @comparing ||= begin
37
37
  comparing = []
38
38
 
39
- data.rows.each do |row|
39
+ data.try(:rows).try(:each) do |row|
40
40
  row_data = []
41
41
  row.dimensions.each do |dimension|
42
42
  row_data << dimension
43
43
  end
44
44
 
45
- if row.metrics.second
46
- row.metrics.second.values.each do |value|
47
- row_data << value
48
- end
45
+ row.try(:metrics).try(:second).try(:values).try(:each) do |value|
46
+ row_data << value
49
47
  end
50
48
 
51
49
  comparing << Hash[fields.zip(row_data)]
@@ -59,7 +57,7 @@ module Hisui
59
57
  @rows ||= begin
60
58
  rows = []
61
59
 
62
- data.rows.each do |row|
60
+ data.try(:rows).try(:each) do |row|
63
61
  dimension_values = row.dimensions
64
62
  primary_data = []
65
63
  comparing_data = []
@@ -1,3 +1,3 @@
1
1
  module Hisui
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hisui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ikepon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-28 00:00:00.000000000 Z
11
+ date: 2018-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails