Class: BlockKit::Layout::Video

Inherits:
Base
  • Object
show all
Defined in:
lib/block_kit/layout/video.rb

Constant Summary collapse

MAX_ALT_TEXT_LENGTH =
2000
MAX_AUTHOR_NAME_LENGTH =
50
MAX_DESCRIPTION_LENGTH =
200
MAX_URL_LENGTH =
3000
MAX_PROVIDER_NAME_LENGTH =
50
MAX_TITLE_LENGTH =
200

Constants inherited from Base

Base::MAX_BLOCK_ID_LENGTH

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize

Methods inherited from Base

#==, fix, #fix_validation_errors, #fix_validation_errors!, fixes, inherited, #initialize, inspect, #inspect, #pretty_print, #to_json

Constructor Details

This class inherits a constructor from BlockKit::Layout::Base

Instance Method Details

#as_jsonObject



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/block_kit/layout/video.rb', line 58

def as_json(*)
  super.merge(
    alt_text: alt_text,
    author_name: author_name,
    description: description&.as_json,
    provider_icon_url: provider_icon_url,
    provider_name: provider_name,
    title: title&.as_json,
    title_url: title_url,
    thumbnail_url: thumbnail_url,
    video_url: video_url
  ).compact
end