module MinecraftAuth
Constants
- BASE_URL
- ENDPOINT
- PROTOCOL
- VERSION
Public Class Methods
account(user, pass)
click to toggle source
# File lib/minecraft_auth.rb, line 9 def self.account(user, pass) Account.new(user, pass) end
username_to_uuid(username)
click to toggle source
# File lib/minecraft_auth.rb, line 13 def self.username_to_uuid(username) response = HTTParty.post("https://api.mojang.com/profiles/minecraft", :body => [username].to_json, :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json'} ) if response.length >= 1 return response[0]["id"] else return nil end end