autopilothq 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/autopilothq.rb +11 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8dcad78844f505e7e3e4f232b753ccde1f58488
4
- data.tar.gz: 60defc4db2fd4c7656cbdc51597eecba4903760c
3
+ metadata.gz: 3cd59b911c8f34f7d28ab0a932ff2af9f9808c73
4
+ data.tar.gz: 99260f3c28ad7032684afd188b1980af4d9096e1
5
5
  SHA512:
6
- metadata.gz: 720c523410cbb55c63086b31316a91b81fc9d150e0a06a4d144b9c06f75d576396c5428c765abf1db1273d7aeb8494b6040ea33e16b4244c6d7d4ee19c6ee4dd
7
- data.tar.gz: 86f17874f0bf979ce97aac9ddac9d1fb008daee8a895e63f38ab7ebba9845a931fd309f784a481f7ac1545fd1b3d33e62fa22dd94287a3f65d13031969ba3106
6
+ metadata.gz: c85684c00362e1dff611414cf1692200247f9fb96db9d7227819d6979d93b1e949a178e36d1e6bfc25230a67a79baaea3d701036faeb293eebdd84712c1b404f
7
+ data.tar.gz: 81720b0d7e203340adc05eaf22a9e9dfe027a7795f6689c1562016016966aa92a707837d87eb3064f833681e6bc9eaaf4c198be990e25b2963163ea60532f920
@@ -8,19 +8,19 @@ class Autopilothq
8
8
  end
9
9
 
10
10
  def self.update_contact(email, custom_attrs)
11
- attributes = {
12
- "contact" => {
13
- "Email" => email,
14
- "FirstName" => "Bill",
15
- "LastName" => "ksjdfn",
16
- "custom" => {}
11
+ if @@api_key.present?
12
+ attributes = {
13
+ "contact" => {
14
+ "Email" => email,
15
+ "custom" => {}
16
+ }
17
+ }
18
+ custom_attrs.each_pair{ |key, value|
19
+ attributes['contact']['custom'][get_key_name(key, value)] = value
17
20
  }
18
- }
19
- custom_attrs.each_pair{ |key, value|
20
- attributes['contact']['custom'][get_key_name(key, value)] = value
21
- }
22
21
 
23
- response = RestClient.post 'https://api2.autopilothq.com/v1/contact', attributes.to_json, headers
22
+ response = RestClient.post 'https://api2.autopilothq.com/v1/contact', attributes.to_json, headers
23
+ end
24
24
 
25
25
  return true
26
26
  rescue RestClient::RequestFailed => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autopilothq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Culbertson
@@ -45,7 +45,7 @@ extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
47
  - lib/autopilothq.rb
48
- homepage:
48
+ homepage: https://github.com/jjculber/autopilothq-ruby
49
49
  licenses:
50
50
  - MIT
51
51
  metadata: {}