Class: Slack::BlockKit::Layout::RichText::RichTextQuote

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from RichTextElements

#channel, #emoji, #link, #text, #user, #usergroup

Constructor Details

#initialize(border: nil) {|_self| ... } ⇒ RichTextQuote

Returns a new instance of RichTextQuote.

Yields:

  • (_self)

Yield Parameters:



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

#borderObject

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

#elementsObject

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_jsonObject



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