hisui 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/hisui/response.rb +5 -7
- data/lib/hisui/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b39bcdc510844184ee5b7115e3c5993498d596b022902ca9af4b7ad045847082
|
4
|
+
data.tar.gz: '094b0cfe1131f880dc85f65e555aa47f1b343e90927ee3b1e71ebbbce500b717'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 `
|
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,
|
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.
|
data/lib/hisui/response.rb
CHANGED
@@ -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
|
-
|
46
|
-
|
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 = []
|
data/lib/hisui/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|