thinkific 0.0.2 → 0.0.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: e9e7098e5eda6ed52d75fdd9ab071ed237dd5be5
4
- data.tar.gz: 11787388042e396aff89b5040cc94d368685ccba
3
+ metadata.gz: 96242fb28f94a334c923e46d64d2da37836530f1
4
+ data.tar.gz: eebd2df2bff514a5e1a1dd6df326fc0ecc1cc6aa
5
5
  SHA512:
6
- metadata.gz: 37725de0a9a50a3846e63c4937625e91ba81a6a02f0c2a2b2c15a83c967a4c0b6ace04c21c7ab2cf8eedb59c25d798d45df317d3d27abf18c8c403927fa75394
7
- data.tar.gz: 29b37220335d6d1e5da5d030ae524f09ad03924bd03354682a7a592281597be160112a7a468948f3c14e618079264a2275ccba74ec7337b18f685b7b08aa3e79
6
+ metadata.gz: 5101e1f922b6364cf1c69f3862b16cc89ffd9887e7e908d9cfc00b705914e7a633db61e46fbb257e25eff078e06dbc66e8431b4aad72f7cbf224f3aae58af16e
7
+ data.tar.gz: fac0db6f8114c978ac35e3d8c4ddb52b2384e1f523311b8a794af294820c1ddd42e0c647be4b76866a9327e1921d1f70e5198fb2ee7a097b1af1ca744d822c3a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -33,11 +33,17 @@ new_user.delete
33
33
  module Thinkific
34
34
  DOMAIN = 'https://api.thinkific.com'
35
35
 
36
- HEADERS = {
37
- 'Content-Type' => 'application/json',
38
- 'X-Auth-Subdomain' => THINKIFIC_SUBDOMAIN,
39
- 'X-Auth-API-Key' => THINKIFIC_KEY
40
- }
36
+ def self.headers
37
+ return {
38
+ 'Content-Type' => 'application/json',
39
+ 'X-Auth-Subdomain' => ::THINKIFIC_SUBDOMAIN,
40
+ 'X-Auth-API-Key' => ::THINKIFIC_KEY
41
+ }
42
+ end
43
+
44
+ def self.query
45
+ return { :limit => 10000 }
46
+ end
41
47
 
42
48
  end
43
49
 
@@ -4,7 +4,7 @@ class Thinkific::Course
4
4
 
5
5
  def self.all
6
6
  result = HTTParty.get "#{Thinkific::DOMAIN}/api/public/v1/courses",
7
- :headers => Thinkific::HEADERS,
7
+ :headers => Thinkific.headers,
8
8
  :query => { :limit => 10000 }
9
9
  rs = JSON.parse result.body
10
10
  return rs['items']
@@ -4,10 +4,25 @@ class Thinkific::User
4
4
 
5
5
  def self.get id
6
6
  puts "+++ get one user"
7
+ raise 'not implemented'
8
+ end
9
+
10
+ # find by email
11
+ def self.where delta={}
12
+ if delta[:email]
13
+ result = HTTParty.get "#{Thinkific::DOMAIN}/api/public/v1/users",
14
+ :headers => Thinkific.headers,
15
+ :query => Thinkific.query.merge( :query => delta )
16
+ rs = JSON.parse result.body
17
+ return rs['items'][0]
18
+ else
19
+ raise 'not implemented'
20
+ end
7
21
  end
8
22
 
9
23
  def self.all
10
24
  puts "+++ all users"
25
+ raise 'not implemented'
11
26
  end
12
27
 
13
28
  end
@@ -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.2 ruby lib
5
+ # stub: thinkific 0.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "thinkific"
9
- s.version = "0.0.2"
9
+ s.version = "0.0.3"
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - v p