Class: Discordrb::Webhooks::View::SeparatorBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/webhooks/view.rb

Overview

A separator allows you to add a barrier between components.

Instance Method Summary collapse

Constructor Details

#initialize(divider:, id: nil, spacing: nil) ⇒ SeparatorBuilder

Create a separator component.

Parameters:

  • divider (true, false)

    Whether or not the separator should act as a visible barrier.

  • id (Integer, nil) (defaults to: nil)

    The unique 32-bit ID of the separator component.

  • spacing (Symbol, Integer) (defaults to: nil)

    The size of the separator component's padding. See Discordrb::Webhooks::View::SEPARATOR_SIZES.



230
231
232
233
234
# File 'lib/discordrb/webhooks/view.rb', line 230

def initialize(divider:, id: nil, spacing: nil)
  @id = id
  @divider = divider
  @spacing = SEPARATOR_SIZES[spacing] || spacing
end