Class: RubyCord::AllowedMentions
- Inherits:
-
Object
- Object
- RubyCord::AllowedMentions
- Defined in:
- lib/rubycord/allowed_mentions.rb
Overview
Represents a allowed mentions in a message.
Instance Attribute Summary collapse
-
#everyone ⇒ Boolean
Whether to allow @everyone or @here.
-
#replied_user ⇒ Boolean
Whether to ping the user that sent the message to reply.
-
#roles ⇒ Boolean, Array<RubyCord::Role>
The roles to allow, or false to disable.
-
#users ⇒ Boolean, Array<RubyCord::User>
The users to allow, or false to disable.
Instance Method Summary collapse
-
#initialize(everyone: nil, roles: nil, users: nil, replied_user: nil) ⇒ AllowedMentions
constructor
Initializes a new instance of the AllowedMentions class.
-
#inspect ⇒ String
Object class and attributes.
Constructor Details
#initialize(everyone: nil, roles: nil, users: nil, replied_user: nil) ⇒ AllowedMentions
Initializes a new instance of the AllowedMentions class.
26 27 28 29 30 31 |
# File 'lib/rubycord/allowed_mentions.rb', line 26 def initialize(everyone: nil, roles: nil, users: nil, replied_user: nil) @everyone = !everyone.nil? @roles = roles @users = users @replied_user = replied_user end |
Instance Attribute Details
#everyone ⇒ Boolean
Returns Whether to allow @everyone or @here.
10 11 12 |
# File 'lib/rubycord/allowed_mentions.rb', line 10 def everyone @everyone end |
#replied_user ⇒ Boolean
Returns Whether to ping the user that sent the message to reply.
16 17 18 |
# File 'lib/rubycord/allowed_mentions.rb', line 16 def replied_user @replied_user end |
#roles ⇒ Boolean, Array<RubyCord::Role>
Returns The roles to allow, or false to disable.
12 13 14 |
# File 'lib/rubycord/allowed_mentions.rb', line 12 def roles @roles end |
#users ⇒ Boolean, Array<RubyCord::User>
Returns The users to allow, or false to disable.
14 15 16 |
# File 'lib/rubycord/allowed_mentions.rb', line 14 def users @users end |
Instance Method Details
#inspect ⇒ String
Returns Object class and attributes.
34 35 36 |
# File 'lib/rubycord/allowed_mentions.rb', line 34 def inspect "#<#{self.class} @everyone=#{@everyone} @roles=#{@roles} @users=#{@users} @replied_user=#{@replied_user}>" end |