google_api 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ ## v1.0.2
2
+
3
+ * ids is convert to integer
4
+ * ids is checked befere execute
5
+ * check error after execute
@@ -80,7 +80,7 @@ module GoogleApi
80
80
  end
81
81
 
82
82
  def #{key}=(value)
83
- type?(value, Integer)
83
+ value = value.to_i
84
84
 
85
85
  @#{key} = value
86
86
  end
@@ -293,6 +293,10 @@ module GoogleApi
293
293
  self.ids = Ga.id
294
294
  end
295
295
 
296
+ if @ids.nil? || @ids == 0
297
+ raise GoogleApi::GaError, "Ids is required."
298
+ end
299
+
296
300
  @parameters = {}
297
301
 
298
302
  @parameters['ids'] = "ga:#{@ids}"
@@ -325,6 +329,10 @@ module GoogleApi
325
329
  result = _session.client.execute( api_method: _session.api.data.ga.get,
326
330
  parameters: parameters )
327
331
 
332
+ if result.error?
333
+ raise GoogleApi::GaError, result.error_message
334
+ end
335
+
328
336
  _cache.write(parameters, result, @cache) if @cache.is_a?(Integer)
329
337
 
330
338
  result
@@ -1,3 +1,3 @@
1
1
  module GoogleApi
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -69,6 +69,7 @@ files:
69
69
  - .gitignore
70
70
  - .rspec
71
71
  - .travis.yml
72
+ - CHANGELOG.md
72
73
  - Gemfile
73
74
  - LICENSE
74
75
  - README.md