class DDAPI::Guild
Represents a DRPG guild.
Attributes
@return [String, nil] The Discord Channel ID of the guild. `nil` if there is no channel.
@return [Integer] The combined deaths by the guild members.
@return [String] The description of the guild.
@return [String] The description of the guild.
@return [Integer] The combined deaths by the guild members.
@return [Integer] The amount gold in the guild.
@return [String] The icon of the guild.
@return [Array<String>] Array of icons the guild has bought.
@return [Integer] The ID of the guild.
@return [String] The icon image URL to the guild's icon.
@return [Integer] The combined enemies slain by the guild members.
@return [User] The user object of the guild owner.
@return [Integer] The level of the guild.
@return [Integer] The level requirement of the guild.
@return [Integer] The maximum amount of people that can be in the guild.
@return [String] The name of the guild.
@return [true, false] Whether the guild is open.
@return [User] The user object of the guild owner.
@return [String, nil] The Discord Role ID of the guild. `nil` if there is no role.
@return [Integer] The combined enemies slain by the guild members.
Public Class Methods
# File lib/dd-api/classes.rb, line 146 def initialize(data, app) @data = data # gdata = data['guild'] gdata = data @name = data['name'] @open = data['open'] @level = gdata['level'] @description = gdata['desc'] @gold = gdata['gold'] @kills = @data['slain'] @deaths = @data['deaths'] @icon = HTMLEntities.new.decode(gdata['icon']) @icon_url = API.guild_icon_url(gdata['icon']) @icons = gdata['icons'].map {|icon| HTMLEntities.new.decode(icon) } @id = data['id'] @members = gdata['members'] @level_requirement = gdata['levelreq'] @max = gdata['max'] @owner = @app.user(gdata['owner']) @role = gdata['role'].empty? ? nil : gdata['role'] @channel = gdata['channel'].empty? ? nil : gdata['channel'] @app = app end
Public Instance Methods
The inspect method is overwritten to give more useful output
# File lib/dd-api/classes.rb, line 171 def inspect "#<DDAPI::Guild name=#{@name} id=#{@id} level=#{@level}>" end