Class: Discordrb::RoleConnectionMetadata
- Inherits:
-
Object
- Object
- Discordrb::RoleConnectionMetadata
- Defined in:
- lib/discordrb/data/role_connection_data.rb
Overview
Metadata about a role's linked connection.
Constant Summary collapse
- TYPES =
Map of connection types.
{ integer_less_than_or_equal: 1, integer_greater_than_or_equal: 2, integer_equal: 3, integer_not_equal: 4, datetime_less_than_or_equal: 5, datetime_greater_than_or_equal: 6, boolean_equal: 7, boolean_not_equal: 8 }.freeze
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The description of the metadata field.
-
#description_localizations ⇒ Hash<String => String>
readonly
The description localizations of the metadata field.
-
#key ⇒ String
readonly
The key of the metadata field.
-
#name ⇒ String
readonly
The name of the metadata field.
-
#name_localizations ⇒ Hash<String => String>
readonly
The name localizations of the metadata field.
-
#type ⇒ Integer
readonly
The value of the metadata field.
Instance Method Summary collapse
-
#boolean_equal? ⇒ true, false
Whether the boolean metadata value is equivalent to the server's configured boolean value.
-
#boolean_not_equal? ⇒ true, false
Whether the boolean metadata value is not equivalent to the server's configured boolean value.
-
#datetime_greater_than_or_equal? ⇒ true, false
Whether the ISO8601 date is greater than or equivalent to the server's configured number of days before a date.
-
#datetime_less_than_or_equal? ⇒ true, false
Whether the ISO8601 date is less than or equivalent to the server's configured number of days before a date.
-
#integer_equal? ⇒ true, false
Whether the numeric metadata value is equivalent to the server's configured numeric value.
-
#integer_greater_than_or_equal? ⇒ true, false
Whether the numeric metadata value is greater than or equivalent to the server's configured numeric value.
-
#integer_less_than_or_equal? ⇒ true, false
Whether the numeric metadata value is less than or equivalent to the server's configured numeric value.
-
#integer_not_equal? ⇒ true, false
Whether the numeric metadata value is not equivalent to the server's configured numeric value.
Instance Attribute Details
#description ⇒ String (readonly)
Returns the description of the metadata field.
28 29 30 |
# File 'lib/discordrb/data/role_connection_data.rb', line 28 def description @description end |
#description_localizations ⇒ Hash<String => String> (readonly)
Returns the description localizations of the metadata field.
34 35 36 |
# File 'lib/discordrb/data/role_connection_data.rb', line 34 def description_localizations @description_localizations end |
#key ⇒ String (readonly)
Returns the key of the metadata field.
19 20 21 |
# File 'lib/discordrb/data/role_connection_data.rb', line 19 def key @key end |
#name ⇒ String (readonly)
Returns the name of the metadata field.
22 23 24 |
# File 'lib/discordrb/data/role_connection_data.rb', line 22 def name @name end |
#name_localizations ⇒ Hash<String => String> (readonly)
Returns the name localizations of the metadata field.
31 32 33 |
# File 'lib/discordrb/data/role_connection_data.rb', line 31 def name_localizations @name_localizations end |
#type ⇒ Integer (readonly)
Returns the value of the metadata field.
25 26 27 |
# File 'lib/discordrb/data/role_connection_data.rb', line 25 def type @type end |
Instance Method Details
#boolean_equal? ⇒ true, false
Returns whether the boolean metadata value is equivalent to the server's configured boolean value.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#boolean_not_equal? ⇒ true, false
Returns whether the boolean metadata value is not equivalent to the server's configured boolean value.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#datetime_greater_than_or_equal? ⇒ true, false
Returns whether the ISO8601 date is greater than or equivalent to the server's configured number of days before a date.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#datetime_less_than_or_equal? ⇒ true, false
Returns whether the ISO8601 date is less than or equivalent to the server's configured number of days before a date.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#integer_equal? ⇒ true, false
Returns whether the numeric metadata value is equivalent to the server's configured numeric value.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#integer_greater_than_or_equal? ⇒ true, false
Returns whether the numeric metadata value is greater than or equivalent to the server's configured numeric value.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#integer_less_than_or_equal? ⇒ true, false
Returns whether the numeric metadata value is less than or equivalent to the server's configured numeric value.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#integer_not_equal? ⇒ true, false
Returns whether the numeric metadata value is not equivalent to the server's configured numeric value.
63 64 65 66 67 |
# File 'lib/discordrb/data/role_connection_data.rb', line 63 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |