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:



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

def icon
  @icon
end

#id -> Discorb::Snowflake (readonly)

Returns The team's ID.

Returns:



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

def id
  @id
end

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

Returns The team's member.

Returns:



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

def members
  @members
end

#name -> String (readonly)

Returns The team's name.

Returns:

  • (String)

    The team's name.



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

def name
  @name
end

#owner_user_id -> Discorb::Snowflake (readonly)

Returns The team's owner's ID.

Returns:



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

def owner_user_id
  @owner_user_id
end

Instance Method Details

#inspect -> Object



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

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

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

The team's owner.

Returns:



128
129
130
# File 'lib/discorb/application.rb', line 128

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