Class: Discordrb::Role
- Inherits:
-
Object
- Object
- Discordrb::Role
- Defined in:
- lib/discordrb/data.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#hoist ⇒ Object
readonly
Returns the value of attribute hoist.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
Instance Method Summary collapse
-
#initialize(data, bot, server = nil) ⇒ Role
constructor
A new instance of Role.
- #update_from(other) ⇒ Object
Constructor Details
#initialize(data, bot, server = nil) ⇒ Role
Returns a new instance of Role.
126 127 128 129 130 131 132 |
# File 'lib/discordrb/data.rb', line 126 def initialize(data, bot, server = nil) = Permissions.new(data['permissions']) @name = data['name'] @id = data['id'].to_i @hoist = data['hoist'] @color = ColorRGB.new(data['color']) end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
124 125 126 |
# File 'lib/discordrb/data.rb', line 124 def color @color end |
#hoist ⇒ Object (readonly)
Returns the value of attribute hoist.
123 124 125 |
# File 'lib/discordrb/data.rb', line 123 def hoist @hoist end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
122 123 124 |
# File 'lib/discordrb/data.rb', line 122 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
121 122 123 |
# File 'lib/discordrb/data.rb', line 121 def name @name end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
120 121 122 |
# File 'lib/discordrb/data.rb', line 120 def end |
Instance Method Details
#update_from(other) ⇒ Object
134 135 136 137 138 139 |
# File 'lib/discordrb/data.rb', line 134 def update_from(other) = other. @name = other.name @hoist = other.hoist @color = other.color end |