Class: Discordrb::ActivitySet

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/discordrb/data/activity.rb

Overview

A collection of the user's activities.

Instance Method Summary collapse

Instance Method Details

#custom_statusArray<Activity>

Returns all activities of type Discordrb::Activity::CUSTOM.

Returns:



260
261
262
# File 'lib/discordrb/data/activity.rb', line 260

def custom_status
  @activities.select { |act| act.type == Activity::CUSTOM }
end

#gamesArray<Activity>

Returns all activities of type Discordrb::Activity::GAME.

Returns:



240
241
242
# File 'lib/discordrb/data/activity.rb', line 240

def games
  @activities.select { |act| act.type == Activity::GAME }
end

#listeningArray<Activity>

Returns all activities of type Discordrb::Activity::LISTENING.

Returns:



250
251
252
# File 'lib/discordrb/data/activity.rb', line 250

def listening
  @activities.select { |act| act.type == Activity::LISTENING }
end

#streamingArray<Activity>

Returns all activities of type Discordrb::Activity::STREAMING.

Returns:



245
246
247
# File 'lib/discordrb/data/activity.rb', line 245

def streaming
  @activities.select { |act| act.type == Activity::STREAMING }
end

#to_aArray<Activity>

Returns all activities.

Returns:



235
236
237
# File 'lib/discordrb/data/activity.rb', line 235

def to_a
  @activities
end

#watchingArray<Activity>

Returns all activities of type Discordrb::Activity::WATCHING.

Returns:



255
256
257
# File 'lib/discordrb/data/activity.rb', line 255

def watching
  @activities.select { |act| act.type == Activity::WATCHING }
end