Class: Slack::BlockKit::Block::ImageBlock
- Inherits:
-
Slack::BlockKit::Block
- Object
- Slack::BlockKit::Block
- Slack::BlockKit::Block::ImageBlock
- Defined in:
- lib/slack/block_kit/block/image_block.rb
Instance Attribute Summary collapse
-
#alt_text ⇒ Object
Returns the value of attribute alt_text.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Slack::BlockKit::Block
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Slack::BlockKit::Block
Instance Attribute Details
#alt_text ⇒ Object
Returns the value of attribute alt_text.
8 9 10 |
# File 'lib/slack/block_kit/block/image_block.rb', line 8 def alt_text @alt_text end |
#image_url ⇒ Object
Returns the value of attribute image_url.
8 9 10 |
# File 'lib/slack/block_kit/block/image_block.rb', line 8 def image_url @image_url end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/slack/block_kit/block/image_block.rb', line 8 def title @title end |
Class Method Details
.populate(hash, object) ⇒ Object
10 11 12 13 14 |
# File 'lib/slack/block_kit/block/image_block.rb', line 10 def self.populate(hash, object) object.image_url = hash.fetch(:image_url) object.alt_text = hash.fetch(:alt_text) object.title = hash[:title] if hash.key?(:title) end |
Instance Method Details
#to_h ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/slack/block_kit/block/image_block.rb', line 34 def to_h super.merge( image_url: image_url, alt_text: alt_text, title: title&.to_h ).compact end |