module Spore::Client::Users
Public Instance Methods
login(email, password)
click to toggle source
# File lib/spore/client/users.rb, line 11 def login(email, password) response = post "/users/#{email}/keys", { password: password } @email = email @key = response.body["key"] self end
signed_in?()
click to toggle source
# File lib/spore/client/users.rb, line 24 def signed_in? !email.nil? && !key.nil? end
signup(email, password)
click to toggle source
# File lib/spore/client/users.rb, line 4 def signup(email, password) response = post "/users", { email: email, password: password } @verified = response.body["user"]["verified"] login(email, password) self end
verify(token)
click to toggle source
# File lib/spore/client/users.rb, line 18 def verify(token) response = patch "/users/#{@email}", { token: token } @verified = response.body["user"]["verified"] self end