class Spreader::User

The User class, used for Spreading the response body into different methods

Attributes

obj[R]

Public Class Methods

new(obj) click to toggle source

Instantiates the class variables @param obj [Object] Response Data Object

# File lib/topgg/user.rb, line 7
def initialize(obj)
  @obj = obj
end

Public Instance Methods

admin() click to toggle source

Returns true/false depending on weather the user is an admin or not. @return [Boolean]

# File lib/topgg/user.rb, line 66
def admin
  @obj['admin']
end
avatar() click to toggle source

The avatar of the user @return [String]

# File lib/topgg/user.rb, line 30
def avatar
  "https://cdn.discordapp.com/avatars/#{@obj['id']}/#{@obj['avatar']}.webp?size=1024"
end
certifiedDev() click to toggle source

Returns true/false depending upon if the user is a certified developer or not. @return [Boolean]

# File lib/topgg/user.rb, line 54
def certifiedDev
  @obj['certifiedDev']
end
defAvatar() click to toggle source

The default avatar of the user @return [String]

# File lib/topgg/user.rb, line 36
def defAvatar
  @obj['defAvatar']
end
error() click to toggle source

Check for errors, if any

# File lib/topgg/user.rb, line 14
def error
  @obj['error']
end
id() click to toggle source

The Id of the user

# File lib/topgg/user.rb, line 19
def id
  @obj['id']
end
mod() click to toggle source

Returns true/false depending upon if the user is a moderator or not. @return [Boolean]

# File lib/topgg/user.rb, line 42
def mod
  @obj['mod']
end
social() click to toggle source

Returns an object containing all user social integrations. @return [Object]

# File lib/topgg/user.rb, line 60
def social
  @obj['social']
end
supporter() click to toggle source

Returns true/false depending upon if the user is a supporter or not. @return [Boolean]

# File lib/topgg/user.rb, line 48
def supporter
  @obj['supporter']
end
username() click to toggle source

The username of the user

# File lib/topgg/user.rb, line 24
def username
  @obj['username']
end
webMod() click to toggle source

Returns true/false depending on weather the user is a website Moderator or not. @return [Boolean]

# File lib/topgg/user.rb, line 72
def webMod
  @obj['webMod']
end