Sha256: ef0f8ba0cd078b0ca78a191825983f3944565d69f05edeba1c2bdf6a531fb6f5

Contents?: true

Size: 814 Bytes

Versions: 2

Compression:

Stored size: 814 Bytes

Contents

module Mumble
  class User < Model
    attribute :session
    attribute :actor
    attribute :name
    attribute :channel_id
    attribute :hash
    attribute :comment
    attribute :mute
    attribute :deaf
    attribute :self_mute
    attribute :self_deaf

    def current_channel
      client.channels[channel_id]
    end

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

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

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

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

    def muted?
      !!mute || !!self_mute
    end

    def deafened?
      !!deaf || !!self_deaf
    end

    def stats
      client.send_user_stats session: session
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mumble-ruby-1.1.1 lib/mumble-ruby/user.rb
mumble-ruby-1.1.0 lib/mumble-ruby/user.rb