Class: Discorb::ThreadChannel::Member

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

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.



958
959
960
961
962
963
# File 'lib/discorb/channel.rb', line 958

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.



956
957
958
# File 'lib/discorb/channel.rb', line 956

def joined_at
  @joined_at
end

Instance Method Details

#id -> Object



973
974
975
# File 'lib/discorb/channel.rb', line 973

def id
  @user_id
end

#inspect -> Object



981
982
983
# File 'lib/discorb/channel.rb', line 981

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

#member -> Object



969
970
971
# File 'lib/discorb/channel.rb', line 969

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

#thread -> Object



965
966
967
# File 'lib/discorb/channel.rb', line 965

def thread
  @client.channels[@thread_id]
end

#user -> Object



977
978
979
# File 'lib/discorb/channel.rb', line 977

def user
  @cilent.users[@user_id]
end