scoutmetrics 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: b4b7e906a1d36868e2063dd2d25dbad59a8feeac
4
- data.tar.gz: bce2d187558aac3114d7ee3c21085101a514cf21
3
+ metadata.gz: 5e01ec1b200b04f4e59bd8bb9a5e44492f35f81f
4
+ data.tar.gz: e00487b20d11a68e0ceceed4ddb27f67cc38ca1f
5
5
  SHA512:
6
- metadata.gz: 13f74f7a8020b36c407149235b6a30baa3836e51ea57956fb2fed6495189b3ea14ba03868612005fccd3089ded4a29af9fa63692b8479ce56d74c0eee37a4196
7
- data.tar.gz: 2feecdb30daf5478cb73856502bd9d6f4dace781968b67047deca282e8d09e85856dfc80fa1d0be445d8fa95c2f35037c02deb0084cca466360630144399217d
6
+ metadata.gz: 87a61f8a9af8cc3de83f442922dbe7d01fd310acf6bf7838deb88729d5557fb6895a2cc4d8b8aa79d705c744a378ff8b2740b17322e7bebc77e337fd9c068521
7
+ data.tar.gz: 9fb7abeb29a35ba8d1546dd5bc6127914807c147f6a6965bf6acf7fd757dcc977841be8194fec69a7107eb39238e4bbb985f3309632cdb2c706509632ca48829
@@ -18,7 +18,11 @@ module ScoutMetrics
18
18
 
19
19
  # Override save method to post the information to Scout Metrics
20
20
  def save
21
- post_update(id, { signup_date: signup_date, return_date: return_date, active: active })
21
+ params = {}
22
+ params[:signup_date] = signup_date if field_present?(signup_date)
23
+ params[:return_date] = return_date if field_present?(return_date)
24
+ params[:active] = active if field_present?(active)
25
+ post_update(id, params)
22
26
  end
23
27
 
24
28
  # Posts signup date for this user (if it doesn't exist yet the "AppUser" will be created)
@@ -48,6 +52,14 @@ module ScoutMetrics
48
52
 
49
53
  private
50
54
 
55
+ def field_blank?(field)
56
+ field.nil? || field.empty?
57
+ end
58
+
59
+ def field_present?(field)
60
+ !field_blank?(field)
61
+ end
62
+
51
63
  # @return [Json] Returns a msg for the transaction and the status of the request
52
64
  # @return msg explanation of outcome
53
65
  def post_update(id, params)
data/scoutmetrics.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'scoutmetrics'
6
- s.version = '0.1.2'
6
+ s.version = '0.1.3'
7
7
  s.date = '2014-10-20'
8
8
  s.summary = 'Ruby wrapper for the Scout Metrics API'
9
9
  s.description = 'Ruby wrapper for the Scout Metrics API'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scoutmetrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dosty Everts