class MustardClient::UsersClient

Public Instance Methods

add(user_params) click to toggle source
# File lib/MustardClient/users.rb, line 38
def add user_params

  command = {}
  command[:method] = :post
  command[:route] = @mustard_url + "/users"
  command[:params] = {user: user_params}
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end
all() click to toggle source
# File lib/MustardClient/users.rb, line 5
def all

  command = {}
  command[:method] = :get
  command[:route] = @mustard_url + '/users'
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end
delete(user_id) click to toggle source
# File lib/MustardClient/users.rb, line 50
def delete user_id

  command = {}
  command[:method] = :delete
  command[:route] = @mustard_url + "/users/#{user_id}"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end
find(user_id) click to toggle source
# File lib/MustardClient/users.rb, line 16
def find user_id

  command = {}
  command[:method] = :get
  command[:route] = @mustard_url + "/users/#{user_id}"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end
find_by_username(username) click to toggle source
# File lib/MustardClient/users.rb, line 27
def find_by_username username

  command = {}
  command[:method] = :get
  command[:route] = @mustard_url + "/users/find/#{ username}"
  command[:headers] = {'User-Token' => @user_token}

  execute(command)

end
reset_password(user_id, password_token, new_password) click to toggle source
# File lib/MustardClient/users.rb, line 84
def reset_password user_id, password_token, new_password

  command = {}
  command[:method] = :post
  command[:route] = @mustard_url + "/users/#{user_id}/reset-password/#{password_token}"
  command[:params] = {user: {'password' => new_password}}

  execute(command)

end
trigger_password_reset(username, redirect_url) click to toggle source
# File lib/MustardClient/users.rb, line 73
def trigger_password_reset username, redirect_url

  command = {}
  command[:method] = :post
  command[:route] = @mustard_url + "/users/reset-password"
  command[:params] = {user: {email: username}, 'redirect-to' => redirect_url, }

  execute(command)

end
update(user_id, user_params) click to toggle source
# File lib/MustardClient/users.rb, line 61
def update user_id, user_params

  command = {}
  command[:method] = :put
  command[:route] = @mustard_url + "/users/#{user_id}"
  command[:headers] = {'User-Token' => @user_token}
  command[:params] = {user: user_params}

  execute(command)

end