Class: RubyCord::Guild::ThreadChannel::Member
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- RubyCord::Guild::ThreadChannel::Member
- Defined in:
- lib/rubycord/guild/channel/thread.rb
Overview
Represents a member in a thread.
Instance Attribute Summary collapse
-
#joined_at ⇒ Object
readonly
Returns the value of attribute joined_at.
Instance Method Summary collapse
-
#id ⇒ RubyCord::Snowflake
The ID of the member.
-
#initialize(client, data, guild_id) ⇒ Member
constructor
A new instance of Member.
-
#inspect ⇒ String
Object class and attributes.
-
#member ⇒ RubyCord::Guild::Member
The member of the member.
-
#thread ⇒ RubyCord::Guild::ThreadChannel
The thread of the member.
-
#user ⇒ RubyCord::User
The user of the member.
Methods inherited from DiscordModel
Constructor Details
#initialize(client, data, guild_id) ⇒ Member
Returns a new instance of Member.
332 333 334 335 336 337 338 |
# File 'lib/rubycord/guild/channel/thread.rb', line 332 def initialize(client, data, guild_id) @client = client @thread_id = data[:id] @user_id = Snowflake.new(data[:user_id]) @joined_at = Time.iso8601(data[:join_timestamp]) @guild_id = guild_id end |
Instance Attribute Details
#joined_at ⇒ Object (readonly)
Returns the value of attribute joined_at.
330 331 332 |
# File 'lib/rubycord/guild/channel/thread.rb', line 330 def joined_at @joined_at end |
Instance Method Details
#id ⇒ RubyCord::Snowflake
Returns The ID of the member.
351 352 353 |
# File 'lib/rubycord/guild/channel/thread.rb', line 351 def id @user_id end |
#inspect ⇒ String
Returns Object class and attributes.
361 362 363 |
# File 'lib/rubycord/guild/channel/thread.rb', line 361 def inspect "#<#{self.class} id=#{@id.inspect}>" end |
#member ⇒ RubyCord::Guild::Member
Returns The member of the member.
346 347 348 |
# File 'lib/rubycord/guild/channel/thread.rb', line 346 def member @client.guilds[@guild_id].members[@user_id] end |
#thread ⇒ RubyCord::Guild::ThreadChannel
Returns The thread of the member.
341 342 343 |
# File 'lib/rubycord/guild/channel/thread.rb', line 341 def thread @client.channels[@thread_id] end |
#user ⇒ RubyCord::User
Returns The user of the member.
356 357 358 |
# File 'lib/rubycord/guild/channel/thread.rb', line 356 def user @client.users[@user_id] end |