Class: Discorb::Application::Team

Inherits:
DiscordModel show all
Defined in:
lib/discorb/application.rb

Overview

Represents a team for an application.

Defined Under Namespace

Classes: Member

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#iconDiscorb::Asset (readonly)

Returns The team's icon.

Returns:



102
103
104
# File 'lib/discorb/application.rb', line 102

def icon
  @icon
end

#idDiscorb::Snowflake (readonly)

Returns The team's ID.

Returns:



100
101
102
# File 'lib/discorb/application.rb', line 100

def id
  @id
end

#membersDiscorb::Application::Team::Member (readonly)

Returns The team's member.

Returns:



108
109
110
# File 'lib/discorb/application.rb', line 108

def members
  @members
end

#nameString (readonly)

Returns The team's name.

Returns:

  • (String)

    The team's name.



104
105
106
# File 'lib/discorb/application.rb', line 104

def name
  @name
end

#owner_user_idDiscorb::Snowflake (readonly)

Returns The team's owner's ID.

Returns:



106
107
108
# File 'lib/discorb/application.rb', line 106

def owner_user_id
  @owner_user_id
end

Instance Method Details

#inspectObject



135
136
137
# File 'lib/discorb/application.rb', line 135

def inspect
  "#<#{self.class} id=#{@id}>"
end

#ownerDiscorb::Application::Team::Member

The team's owner.

Returns:



131
132
133
# File 'lib/discorb/application.rb', line 131

def owner
  @members.find { |m| m.user.id == @owner_user_id }
end