Class: Slack::BlockKit::Element::Image
- Inherits:
-
Object
- Object
- Slack::BlockKit::Element::Image
- Defined in:
- lib/slack/block_kit/element/image.rb
Overview
An element to insert an image - this element can be used in section and context blocks only. If you want a block with only an image in it, you’re looking for the image block. (Slack::BlockKit::Layout::Image)
Constant Summary collapse
- TYPE =
'image'
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(image_url:, alt_text:) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(image_url:, alt_text:) ⇒ Image
Returns a new instance of Image.
14 15 16 17 |
# File 'lib/slack/block_kit/element/image.rb', line 14 def initialize(image_url:, alt_text:) @image_url = image_url @alt_text = alt_text end |
Instance Method Details
#as_json ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/slack/block_kit/element/image.rb', line 19 def as_json(*) { type: TYPE, image_url: @image_url, alt_text: @alt_text } end |