Class: OnyxCord::Components::File

Inherits:
Object
  • Object
show all
Defined in:
lib/onyxcord/models/component.rb

Overview

A component that allows you to display an attachment.

Instance Attribute Summary collapse

Instance Attribute Details

#idInteger (readonly)

Returns the numeric identifier of the file.

Returns:

  • (Integer)

    the numeric identifier of the file.



425
426
427
# File 'lib/onyxcord/models/component.rb', line 425

def id
  @id
end

#mediaMediaItem (readonly)

Returns the unfurled media item of the file.

Returns:

  • (MediaItem)

    the unfurled media item of the file.



435
436
437
# File 'lib/onyxcord/models/component.rb', line 435

def media
  @media
end

#nameString (readonly)

Returns the name of the file that was uploaded.

Returns:

  • (String)

    the name of the file that was uploaded.



428
429
430
# File 'lib/onyxcord/models/component.rb', line 428

def name
  @name
end

#sizeInteger (readonly)

Returns the size of the file that was uploaded in bytes.

Returns:

  • (Integer)

    the size of the file that was uploaded in bytes.



432
433
434
# File 'lib/onyxcord/models/component.rb', line 432

def size
  @size
end

#spoilertrue, false (readonly) Also known as: spoiler?

Returns whether or not the file should be blurred out.

Returns:

  • (true, false)

    whether or not the file should be blurred out.



439
440
441
# File 'lib/onyxcord/models/component.rb', line 439

def spoiler
  @spoiler
end