class DDAPI::User
Represents a DRPG user.
Attributes
@return [Integer] How much deaths that user has
@return [true, false] whether the user donated to Discord Dungeons or not.
@return [true, false] whether the user donated to Discord Dungeons or not.
@return [Integer] How much experience that user has
@return [Integer] How much deaths that user has
@return [Integer] How much gold that user has
@return [Integer] How much health that user has
@return [Integer] How much health that user has
@return [Integer] The ID of the user.
@return [Integer] How much kills that user has
@return [Integer] The level at that time, of the user.
@return [Integer] How much maximun health that user has
@return [Integer] How much maximun health that user has
@return [Srting] The name of the user.
@return [Srting] The name of the user.
@return [Integer] How much experience that user has
Public Class Methods
# File lib/dd-api/classes.rb, line 61 def initialize(data, app) @data = data['data'] @id = data['id'] @name = @data['name'] @level = @data['level'] @hp = @data['hp'] @max_hp = @data['maxhp'] @gold = @data['gold'] @xp = @data['xp'] @kills = @data['kills'] @deaths = @data['deaths'] @weapon_id = @data['weapon'] @donated = @data['donate'] @guild = @data['guild'] @app = app end
Public Instance Methods
@return [Guild, nil] the user's guild
# File lib/dd-api/classes.rb, line 79 def guild if @guild != "" @app.guild(@guild) else nil end end
The inspect method is overwritten to give more useful output
# File lib/dd-api/classes.rb, line 88 def inspect "#<DDAPI::User name=#{@name} id=#{@id} level=#{@level}>" end