Class: MijDiscord::Data::VoiceState
- Inherits:
-
Object
- Object
- MijDiscord::Data::VoiceState
- Defined in:
- lib/mij-discord/data/voice.rb
Instance Attribute Summary collapse
-
#deaf ⇒ Object
(also: #deaf?)
readonly
Returns the value of attribute deaf.
-
#mute ⇒ Object
(also: #mute?)
readonly
Returns the value of attribute mute.
-
#self_deaf ⇒ Object
(also: #self_deaf?)
readonly
Returns the value of attribute self_deaf.
-
#self_mute ⇒ Object
(also: #self_mute?)
readonly
Returns the value of attribute self_mute.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#voice_channel ⇒ Object
(also: #channel)
readonly
Returns the value of attribute voice_channel.
Instance Method Summary collapse
-
#initialize(user) ⇒ VoiceState
constructor
A new instance of VoiceState.
- #inspect ⇒ Object
- #update_data(channel, data) ⇒ Object
Constructor Details
#initialize(user) ⇒ VoiceState
Returns a new instance of VoiceState.
22 23 24 |
# File 'lib/mij-discord/data/voice.rb', line 22 def initialize(user) @user = user end |
Instance Attribute Details
#deaf ⇒ Object (readonly) Also known as: deaf?
Returns the value of attribute deaf.
10 11 12 |
# File 'lib/mij-discord/data/voice.rb', line 10 def deaf @deaf end |
#mute ⇒ Object (readonly) Also known as: mute?
Returns the value of attribute mute.
7 8 9 |
# File 'lib/mij-discord/data/voice.rb', line 7 def mute @mute end |
#self_deaf ⇒ Object (readonly) Also known as: self_deaf?
Returns the value of attribute self_deaf.
16 17 18 |
# File 'lib/mij-discord/data/voice.rb', line 16 def self_deaf @self_deaf end |
#self_mute ⇒ Object (readonly) Also known as: self_mute?
Returns the value of attribute self_mute.
13 14 15 |
# File 'lib/mij-discord/data/voice.rb', line 13 def self_mute @self_mute end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'lib/mij-discord/data/voice.rb', line 5 def user @user end |
#voice_channel ⇒ Object (readonly) Also known as: channel
Returns the value of attribute voice_channel.
19 20 21 |
# File 'lib/mij-discord/data/voice.rb', line 19 def voice_channel @voice_channel end |
Instance Method Details
#inspect ⇒ Object
35 36 37 38 |
# File 'lib/mij-discord/data/voice.rb', line 35 def inspect MijDiscord.make_inspect(self, :user, :mute, :deaf, :self_mute, :self_deaf, :voice_channel) end |
#update_data(channel, data) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/mij-discord/data/voice.rb', line 26 def update_data(channel, data) @voice_channel = channel @mute = data.fetch('mute', @mute) @deaf = data.fetch('deaf', @deaf) @self_mute = data.fetch('self_mute', @self_mute) @self_deaf = data.fetch('self_deaf', @self_deaf) end |