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 +4 -4
- data/VERSION +1 -1
- data/lib/thinkific/user.rb +23 -1
- data/thinkific.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dcbcbd8d4a0c07f4283069ad4d02ea606ea93d2
|
4
|
+
data.tar.gz: 24282503977b8cc65d3a06133f2c2a7523329388
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e318122d7f2e31ff626ff1eadc50b13520752cd09ba7841ae4e99b9a18fcdb66d3040ffa4402839db64f8dbb96b59c0cdfe6b39e5e68d05bd7128a63b10c5770
|
7
|
+
data.tar.gz: bf754eb54b54bd3b391688cc8c3d8f2a71d9b6c117eecceb36c3ff74fef5524e8c1e185e721e80b1ea67c82eed6ec6cdd5fe48c4e260319e7e05d6378f9d9017
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/thinkific/user.rb
CHANGED
@@ -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,
|
data/thinkific.gemspec
CHANGED
@@ -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.
|
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.
|
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"]
|