class Discordrb::Role::RoleWriter

This class is used internally as a wrapper to a Role object that allows easy writing of permission data.

Public Class Methods

new(role, token) click to toggle source

@!visibility private

# File lib/discordrb/data/role.rb, line 74
def initialize(role, token)
  @role = role
  @token = token
end

Public Instance Methods

inspect() click to toggle source

The inspect method is overridden, in this case to prevent the token being leaked

# File lib/discordrb/data/role.rb, line 86
def inspect
  "<RoleWriter role=#{@role} token=...>"
end
write(bits) click to toggle source

Write the specified permission data to the role, without updating the permission cache @param bits [Integer] The packed permissions to write.

# File lib/discordrb/data/role.rb, line 81
def write(bits)
  @role.send(:packed=, bits, false)
end