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

#icon -> Discorb::Asset (readonly)

Returns The team's icon.

Returns:



92
93
94
# File 'lib/discorb/application.rb', line 92

def icon
  @icon
end

#id -> Discorb::Snowflake (readonly)

Returns The team's ID.

Returns:



90
91
92
# File 'lib/discorb/application.rb', line 90

def id
  @id
end

#members -> Discorb::Application::Team::Member (readonly)

Returns The team's member.

Returns:



98
99
100
# File 'lib/discorb/application.rb', line 98

def members
  @members
end

#name -> String (readonly)

Returns The team's name.

Returns:

  • (String)

    The team's name.



94
95
96
# File 'lib/discorb/application.rb', line 94

def name
  @name
end

#owner_user_id -> Discorb::Snowflake (readonly)

Returns The team's owner's ID.

Returns:



96
97
98
# File 'lib/discorb/application.rb', line 96

def owner_user_id
  @owner_user_id
end

Instance Method Details

#inspect -> Object



119
120
121
# File 'lib/discorb/application.rb', line 119

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

#owner -> Discorb::Application::Team::Member

The team's owner.

Returns:



115
116
117
# File 'lib/discorb/application.rb', line 115

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