thinkific 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: c674c9355817d087e38bb5ae1c1504398b421539
4
- data.tar.gz: 400cfd3165f10839b8a86d52e3101a971487150a
3
+ metadata.gz: 6dcbcbd8d4a0c07f4283069ad4d02ea606ea93d2
4
+ data.tar.gz: 24282503977b8cc65d3a06133f2c2a7523329388
5
5
  SHA512:
6
- metadata.gz: 6148554c66ae32e3819f9d2d3397afc41a293b90bad9efe7f2629dce60db89b895a7d47dabb7b845369d55cdbd945d0cc95a699d474c8ebb18954d6626e9c451
7
- data.tar.gz: 2384039352a75cc57a3b7b4024ff13770caf388048943184e3df48b478caed17dbd182dc3074edb0d8617aa40fc161e893942a4da6eb8d09c1bb22402c258c44
6
+ metadata.gz: e318122d7f2e31ff626ff1eadc50b13520752cd09ba7841ae4e99b9a18fcdb66d3040ffa4402839db64f8dbb96b59c0cdfe6b39e5e68d05bd7128a63b10c5770
7
+ data.tar.gz: bf754eb54b54bd3b391688cc8c3d8f2a71d9b6c117eecceb36c3ff74fef5524e8c1e185e721e80b1ea67c82eed6ec6cdd5fe48c4e260319e7e05d6378f9d9017
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -20,8 +20,30 @@ class Thinkific::User
20
20
  end
21
21
  end
22
22
 
23
- def self.create
23
+ def self.create customer={}
24
+ body = {
25
+ :first_name => customer[:first_name],
26
+ :last_name => customer[:last_name],
27
+ :email => customer[:email],
28
+ :send_welcome_email => false # @TODO: should be true?
29
+ }
30
+ result = HTTParty.post "#{Thinkific::DOMAIN}/api/public/v1/users",
31
+ headers: Thinkific.headers,
32
+ body: body
33
+ rs = JSON.parse result.body
34
+ if rs['errors']
35
+ begin
36
+ if rs['errors']['email'][0] == 'has already been taken'
37
+ u = Thinkific::User.where( :email => customer[:email] )
38
+ return u
39
+ end
40
+ end
41
+ else
42
+ return rs
43
+ end
44
+ end
24
45
 
46
+ # works
25
47
  def self.all
26
48
  result = HTTParty.get "#{Thinkific::DOMAIN}/api/public/v1/users",
27
49
  :headers => Thinkific.headers,
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: thinkific 0.0.4 ruby lib
5
+ # stub: thinkific 0.0.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "thinkific"
9
- s.version = "0.0.4"
9
+ s.version = "0.0.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinkific
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - v p