Class: Discordrb::RoleConnectionMetadata

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#descriptionString (readonly)

Returns the description of the metadata field.

Returns:

  • (String)

    the description of the metadata field.



28
29
30
# File 'lib/discordrb/data/role_connection_data.rb', line 28

def description
  @description
end

#description_localizationsHash<String => String> (readonly)

Returns the description localizations of the metadata field.

Returns:

  • (Hash<String => String>)

    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

#keyString (readonly)

Returns the key of the metadata field.

Returns:

  • (String)

    the key of the metadata field.



19
20
21
# File 'lib/discordrb/data/role_connection_data.rb', line 19

def key
  @key
end

#nameString (readonly)

Returns the name of the metadata field.

Returns:

  • (String)

    the name of the metadata field.



22
23
24
# File 'lib/discordrb/data/role_connection_data.rb', line 22

def name
  @name
end

#name_localizationsHash<String => String> (readonly)

Returns the name localizations of the metadata field.

Returns:

  • (Hash<String => String>)

    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

#typeInteger (readonly)

Returns the value of the metadata field.

Returns:

  • (Integer)

    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.

Returns:

  • (true, false)

    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.

Returns:

  • (true, false)

    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.

Returns:

  • (true, false)

    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.

Returns:

  • (true, false)

    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.

Returns:

  • (true, false)

    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.

Returns:

  • (true, false)

    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.

Returns:

  • (true, false)

    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.

Returns:

  • (true, false)

    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