lib/thinkific/user.rb in thinkific-0.0.3 vs lib/thinkific/user.rb in thinkific-0.0.4
- old
+ new
@@ -11,19 +11,24 @@
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]
+ rs = JSON.parse result.body
+ return rs['items'][0]
else
- raise 'not implemented'
+ raise 'not implemented? Expecting email.'
end
end
+ def self.create
+
def self.all
- puts "+++ all users"
- raise 'not implemented'
+ result = HTTParty.get "#{Thinkific::DOMAIN}/api/public/v1/users",
+ :headers => Thinkific.headers,
+ :query => Thinkific.query
+ rs = JSON.parse result.body
+ return rs['items']
end
end