Class: Discorb::Presence

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

Overview

Represents a presence of user.

Defined Under Namespace

Classes: Activity, ClientStatus

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#activitiesArray<Discorb::Presence::Activity> (readonly)

Returns The activities of the user.

Returns:



11
12
13
# File 'lib/discorb/presence.rb', line 11

def activities
  @activities
end

#activityDiscorb::Presence::Activity (readonly)

Returns The activity of the presence.

Returns:



# File 'lib/discorb/presence.rb', line 15

#client_statusDiscorb::Presence::ClientStatus (readonly)

Returns The client status of the user.

Returns:



13
14
15
# File 'lib/discorb/presence.rb', line 13

def client_status
  @client_status
end

#guildDiscorb::Guild (readonly)

Returns The guild of the presence.

Returns:



# File 'lib/discorb/presence.rb', line 15

#status:online, ... (readonly)

Returns The status of the user.

Returns:

  • (:online, :idle, :dnd, :offline)

    The status of the user.



9
10
11
# File 'lib/discorb/presence.rb', line 9

def status
  @status
end

#userDiscorb::User (readonly)

Returns The user of the presence.

Returns:



# File 'lib/discorb/presence.rb', line 15

Instance Method Details

#inspectObject



47
48
49
# File 'lib/discorb/presence.rb', line 47

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