Class: MijDiscord::Data::VoiceState

Inherits:
Object
  • Object
show all
Defined in:
lib/mij-discord/data/voice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#deafObject (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

#muteObject (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_deafObject (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_muteObject (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

#userObject (readonly)

Returns the value of attribute user.



5
6
7
# File 'lib/mij-discord/data/voice.rb', line 5

def user
  @user
end

#voice_channelObject (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

#inspectObject



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