Class: Slack::BlockKit::Layout::RichText::RichTextQuote
- Inherits:
-
Object
- Object
- Slack::BlockKit::Layout::RichText::RichTextQuote
- Includes:
- RichTextElements
- Defined in:
- lib/slack/block_kit/layout/rich_text/rich_text_quote.rb
Overview
Constant Summary collapse
- TYPE =
'rich_text_quote'
Instance Attribute Summary collapse
-
#border ⇒ Object
Returns the value of attribute border.
-
#elements ⇒ Object
Returns the value of attribute elements.
Instance Method Summary collapse
- #append(element) ⇒ Object
- #as_json ⇒ Object
-
#initialize(border: nil) {|_self| ... } ⇒ RichTextQuote
constructor
A new instance of RichTextQuote.
Methods included from RichTextElements
#channel, #emoji, #link, #text, #user, #usergroup
Constructor Details
#initialize(border: nil) {|_self| ... } ⇒ RichTextQuote
Returns a new instance of RichTextQuote.
14 15 16 17 18 19 |
# File 'lib/slack/block_kit/layout/rich_text/rich_text_quote.rb', line 14 def initialize(border: nil) @elements = [] @border = border yield(self) if block_given? end |
Instance Attribute Details
#border ⇒ Object
Returns the value of attribute border.
12 13 14 |
# File 'lib/slack/block_kit/layout/rich_text/rich_text_quote.rb', line 12 def border @border end |
#elements ⇒ Object
Returns the value of attribute elements.
12 13 14 |
# File 'lib/slack/block_kit/layout/rich_text/rich_text_quote.rb', line 12 def elements @elements end |
Instance Method Details
#append(element) ⇒ Object
21 22 23 24 25 |
# File 'lib/slack/block_kit/layout/rich_text/rich_text_quote.rb', line 21 def append(element) @elements << element self end |
#as_json ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/slack/block_kit/layout/rich_text/rich_text_quote.rb', line 27 def as_json(*) { type: TYPE, border: @border, elements: @elements.map(&:as_json) }.compact end |