Class: RubyCord::Guild::ThreadChannel::Member

Inherits:
DiscordModel
  • Object
show all
Defined in:
lib/rubycord/guild/channel/thread.rb

Overview

Represents a member in a thread.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

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_atObject (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

#idRubyCord::Snowflake

Returns The ID of the member.

Returns:



351
352
353
# File 'lib/rubycord/guild/channel/thread.rb', line 351

def id
  @user_id
end

#inspectString

Returns Object class and attributes.

Returns:

  • (String)

    Object class and attributes.



361
362
363
# File 'lib/rubycord/guild/channel/thread.rb', line 361

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

#memberRubyCord::Guild::Member

Returns The member of the member.

Returns:



346
347
348
# File 'lib/rubycord/guild/channel/thread.rb', line 346

def member
  @client.guilds[@guild_id].members[@user_id]
end

#threadRubyCord::Guild::ThreadChannel

Returns The thread of the member.

Returns:



341
342
343
# File 'lib/rubycord/guild/channel/thread.rb', line 341

def thread
  @client.channels[@thread_id]
end

#userRubyCord::User

Returns The user of the member.

Returns:



356
357
358
# File 'lib/rubycord/guild/channel/thread.rb', line 356

def user
  @client.users[@user_id]
end