Class: Discorb::ThreadChannel::Member

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

Overview

Repre

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?, #hash

Constructor Details

#initialize(cilent, data) -> Member

Returns a new instance of Member.



989
990
991
992
993
994
# File 'lib/discorb/channel.rb', line 989

def initialize(cilent, data)
  @cilent = cilent
  @thread_id = data[:id]
  @user_id = data[:user_id]
  @joined_at = Time.iso8601(data[:join_timestamp])
end

Instance Attribute Details

#joined_at -> Object (readonly)

Returns the value of attribute joined_at.



987
988
989
# File 'lib/discorb/channel.rb', line 987

def joined_at
  @joined_at
end

Instance Method Details

#id -> Object



1004
1005
1006
# File 'lib/discorb/channel.rb', line 1004

def id
  @user_id
end

#inspect -> Object



1012
1013
1014
# File 'lib/discorb/channel.rb', line 1012

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

#member -> Object



1000
1001
1002
# File 'lib/discorb/channel.rb', line 1000

def member
  thread && thread.members[@user_id]
end

#thread -> Object



996
997
998
# File 'lib/discorb/channel.rb', line 996

def thread
  @client.channels[@thread_id]
end

#user -> Object



1008
1009
1010
# File 'lib/discorb/channel.rb', line 1008

def user
  @cilent.users[@user_id]
end