flurry 0.3.0 → 0.4.0

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: 74f200311571ba866a1d51214386d824b1b9d3fcd982a149b0f838707886c478
4
- data.tar.gz: 03fa9ee7ac0f313abefc2dfb93e7939048966cea25dc08c96d9bf78740f64d19
3
+ metadata.gz: 92052cc9650bc214947cd3c9add6c5924bc471669cefe385f06e1f44f89be82b
4
+ data.tar.gz: 85f6586951d9e4a83f8fbc6a14ff53b44ca24b83479826e9f7e8f15ec3759e93
5
5
  SHA512:
6
- metadata.gz: 374239c8e7ca0ecedfe3de235ea77186348899b14a31ffae0c21db392e97b8a8e99488062bb51dce8cb0dacd9eb72004055f71f5c4893e7f4ba744ee701737d3
7
- data.tar.gz: 177be332838006fbc41235c892aad920afcfc34f8927e51531a131057dbfb87d61359ea95979128e2beef45c636cfd5cc1f0519020c4346e6abb3f35ecf90538
6
+ metadata.gz: c9dcb1f84823530e9276dff30fa2d974c4c7eefe5a4ec1bde8f948970e45be7f8b6548bab649915e534d5f2c74df06448ea475eaa86bd28b7556d1821846afc4
7
+ data.tar.gz: d6c650ee3d8dfd68004501fba113f6973b5485c4063f1dc19ea33ae67a386008373da8c7262e5661ee9a7b7be6526edfba7a414412f1cfda0bc8ea44e1cb3e9a
@@ -1,11 +1,12 @@
1
1
  module Flurry
2
2
  # Contains all the configuration for the gem
3
3
  class Configuration
4
- attr_accessor :token, :time_zone
4
+ attr_accessor :token, :time_zone, :format
5
5
 
6
6
  def initialize
7
7
  @token = nil
8
8
  @time_zone = nil
9
+ @format = nil
9
10
  end
10
11
  end
11
12
  end
@@ -53,13 +53,21 @@ module Flurry
53
53
  dup.tap { |it| it.havings = clean_havings(havings || {}) }
54
54
  end
55
55
 
56
+ def time_zone(time_zone)
57
+ dup.tap { |it| it.time_zone = time_zone }
58
+ end
59
+
60
+ def format(format)
61
+ dup.tap { |it| it.format = format }
62
+ end
63
+
56
64
  def fetch
57
65
  self.class.get(full_path).response
58
66
  end
59
67
 
60
68
  protected
61
69
 
62
- attr_writer :table, :grain, :dimensions, :metrics, :range, :sorts, :top, :havings
70
+ attr_writer :table, :grain, :dimensions, :metrics, :range, :sorts, :top, :havings, :time_zone, :format
63
71
 
64
72
  private
65
73
 
@@ -133,13 +141,26 @@ module Flurry
133
141
  end.join(',')
134
142
  end
135
143
 
144
+ def time_zone_partial_path
145
+ time_zone = @time_zone || Flurry.configuration.time_zone
146
+ return '' if time_zone.nil? || time_zone.empty?
147
+ '&timeZone=' + time_zone.to_s
148
+ end
149
+
150
+ def format_partial_path
151
+ format = @format || Flurry.configuration.format
152
+ return '' if format.nil? || format.empty?
153
+ '&format=' + format.to_s
154
+ end
155
+
136
156
  def full_path
137
157
  ''.tap do |path|
138
158
  path << base_partial_path
139
159
  path << dimensions_partial_path
140
160
  path << '?'
141
161
  path << 'token=' + Flurry.configuration.token
142
- path << '&timeZone=' + Flurry.configuration.time_zone if Flurry.configuration.time_zone
162
+ path << time_zone_partial_path
163
+ path << format_partial_path
143
164
  path << metrics_partial_path
144
165
  path << sort_partial_path
145
166
  path << having_partial_path
@@ -1,3 +1,3 @@
1
1
  module Flurry
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flurry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Bagué
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-14 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -100,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubyforge_project:
104
- rubygems_version: 2.7.8
103
+ rubygems_version: 3.0.3
105
104
  signing_key:
106
105
  specification_version: 4
107
106
  summary: A wrapper around Flurry Analytics Reporting API