Class: Thinkific::User
- Inherits:
-
Object
- Object
- Thinkific::User
- Defined in:
- lib/thinkific/user.rb
Class Method Summary collapse
- .all ⇒ Object
- .get(id) ⇒ Object
-
.where(delta = {}) ⇒ Object
find by email.
Class Method Details
.all ⇒ Object
23 24 25 26 |
# File 'lib/thinkific/user.rb', line 23 def self.all puts "+++ all users" raise 'not implemented' end |
.get(id) ⇒ Object
5 6 7 8 |
# File 'lib/thinkific/user.rb', line 5 def self.get id puts "+++ get one user" raise 'not implemented' end |
.where(delta = {}) ⇒ Object
find by email
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/thinkific/user.rb', line 11 def self.where delta={} if delta[:email] result = HTTParty.get "#{Thinkific::DOMAIN}/api/public/v1/users", :headers => Thinkific.headers, :query => Thinkific.query.merge( :query => delta ) rs = JSON.parse result.body return rs['items'][0] else raise 'not implemented' end end |