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.
123 124 125 126 127 128 129 |
# File 'lib/discordrb/data.rb', line 123 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.
121 122 123 |
# File 'lib/discordrb/data.rb', line 121 def color @color end |
#hoist ⇒ Object (readonly)
Returns the value of attribute hoist.
120 121 122 |
# File 'lib/discordrb/data.rb', line 120 def hoist @hoist end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
119 120 121 |
# File 'lib/discordrb/data.rb', line 119 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
118 119 120 |
# File 'lib/discordrb/data.rb', line 118 def name @name end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
117 118 119 |
# File 'lib/discordrb/data.rb', line 117 def end |
Instance Method Details
#update_from(other) ⇒ Object
131 132 133 134 135 136 |
# File 'lib/discordrb/data.rb', line 131 def update_from(other) = other. @name = other.name @hoist = other.hoist @color = other.color end |