Module: Slack::BlockKit::Layout::RichText::RichTextElements

Included in:
RichTextPreformatted, RichTextQuote, RichTextSection
Defined in:
lib/slack/block_kit/layout/rich_text/rich_text_elements.rb,
lib/slack/block_kit/layout/rich_text/rich_text_elements/link.rb,
lib/slack/block_kit/layout/rich_text/rich_text_elements/text.rb,
lib/slack/block_kit/layout/rich_text/rich_text_elements/user.rb,
lib/slack/block_kit/layout/rich_text/rich_text_elements/emoji.rb,
lib/slack/block_kit/layout/rich_text/rich_text_elements/channel.rb,
lib/slack/block_kit/layout/rich_text/rich_text_elements/usergroup.rb,
lib/slack/block_kit/layout/rich_text/rich_text_elements/style_helper.rb

Defined Under Namespace

Modules: StyleHelper Classes: Channel, Emoji, Link, Text, User, Usergroup

Instance Method Summary collapse

Instance Method Details

#channel(channel_id:, styles: []) ⇒ Object



9
10
11
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements.rb', line 9

def channel(channel_id:, styles: [])
  append(RichTextElements::Channel.new(channel_id: channel_id, styles: styles))
end

#emoji(name:) ⇒ Object



13
14
15
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements.rb', line 13

def emoji(name:)
  append(RichTextElements::Emoji.new(name: name))
end


17
18
19
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements.rb', line 17

def link(url:, text: nil, unsafe: nil, styles: [])
  append(RichTextElements::Link.new(url: url, text: text, unsafe: unsafe, styles: styles))
end

#text(text:, styles: []) ⇒ Object



21
22
23
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements.rb', line 21

def text(text:, styles: [])
  append(RichTextElements::Text.new(text: text, styles: styles))
end

#user(user_id:, styles: []) ⇒ Object



25
26
27
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements.rb', line 25

def user(user_id:, styles: [])
  append(RichTextElements::User.new(user_id: user_id, styles: styles))
end

#usergroup(usergroup_id:, styles: []) ⇒ Object



29
30
31
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements.rb', line 29

def usergroup(usergroup_id:, styles: [])
  append(RichTextElements::Usergroup.new(usergroup_id: usergroup_id, styles: styles))
end