Class: RubyCord::Client::Gateway::Shard
- Inherits:
-
Object
- Object
- RubyCord::Client::Gateway::Shard
- Defined in:
- lib/rubycord/client/gateway/shard.rb
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
The ID of the shard.
-
#logger ⇒ Logger
readonly
The logger of the shard.
-
#thread ⇒ Thread
readonly
The thread of the shard.
Instance Method Summary collapse
-
#close ⇒ void
Stops the shard.
-
#inspect ⇒ String
Object class and attributes.
-
#start ⇒ void
Starts the shard.
Instance Attribute Details
#id ⇒ Integer (readonly)
Returns The ID of the shard.
12 13 14 |
# File 'lib/rubycord/client/gateway/shard.rb', line 12 def id @id end |
#logger ⇒ Logger (readonly)
Returns The logger of the shard.
16 17 18 |
# File 'lib/rubycord/client/gateway/shard.rb', line 16 def logger @logger end |
#thread ⇒ Thread (readonly)
Returns The thread of the shard.
14 15 16 |
# File 'lib/rubycord/client/gateway/shard.rb', line 14 def thread @thread end |
Instance Method Details
#close ⇒ void
This method returns an undefined value.
Stops the shard.
69 70 71 72 73 |
# File 'lib/rubycord/client/gateway/shard.rb', line 69 def close @status = :closed @main_task&.stop @thread.kill end |
#inspect ⇒ String
Returns Object class and attributes.
76 77 78 |
# File 'lib/rubycord/client/gateway/shard.rb', line 76 def inspect "#<#{self.class} #{id}/#{@shard_count} #{@status}>" end |
#start ⇒ void
This method returns an undefined value.
Starts the shard.
60 61 62 |
# File 'lib/rubycord/client/gateway/shard.rb', line 60 def start @thread.wakeup end |