Class: Discordrb::Role::RoleWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data/role.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#inspectObject

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



86
87
88
# File 'lib/discordrb/data/role.rb', line 86

def inspect
  "<RoleWriter role=#{@role} token=...>"
end

#write(bits) ⇒ Object

Write the specified permission data to the role, without updating the permission cache

Parameters:

  • bits (Integer)

    The packed permissions to write.



81
82
83
# File 'lib/discordrb/data/role.rb', line 81

def write(bits)
  @role.send(:packed=, bits, false)
end