Class: Mumble::User

Inherits:
Model
  • Object
show all
Defined in:
lib/mumble-ruby/user.rb

Instance Method Summary collapse

Methods inherited from Model

attribute, attributes, #initialize, #inspect, #update

Constructor Details

This class inherits a constructor from Mumble::Model

Instance Method Details

#current_channelObject



15
16
17
# File 'lib/mumble-ruby/user.rb', line 15

def current_channel
  client.channels[channel_id]
end

#deafen(bool = true) ⇒ Object



31
32
33
# File 'lib/mumble-ruby/user.rb', line 31

def deafen(bool=true)
  client.send_user_state self_deaf: bool
end

#deafened?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/mumble-ruby/user.rb', line 39

def deafened?
  !!data['deaf'] || !!self_deaf
end

#mute(bool = true) ⇒ Object



27
28
29
# File 'lib/mumble-ruby/user.rb', line 27

def mute(bool=true)
  client.send_user_state self_mute: bool
end

#muted?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/mumble-ruby/user.rb', line 35

def muted?
  !!data['suppress'] || !!data['mute'] || !!self_mute
end

#registerObject



43
44
45
# File 'lib/mumble-ruby/user.rb', line 43

def register
  client.send_user_state(session: session, user_id: 0)
end

#send_image(file) ⇒ Object



23
24
25
# File 'lib/mumble-ruby/user.rb', line 23

def send_image(file)
  client.text_user_img(self, file)
end

#send_text(string) ⇒ Object



19
20
21
# File 'lib/mumble-ruby/user.rb', line 19

def send_text(string)
  client.text_user(self, string)
end

#statsObject



47
48
49
# File 'lib/mumble-ruby/user.rb', line 47

def stats
  client.send_user_stats session: session
end