Sha256: 084a1b57187137c615bf1c7d109ec76bbb357adbc0cedb47c9030716e564a29d

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Slack
  module BlockKit
    module Layout
      class RichText
        module RichTextElements
          # https://api.slack.com/reference/block-kit/blocks#element-types
          def channel(channel_id:, styles: [])
            append(RichTextElements::Channel.new(channel_id: channel_id, styles: styles))
          end

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

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

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slack-ruby-block-kit-0.25.0 lib/slack/block_kit/layout/rich_text/rich_text_elements.rb
slack-ruby-block-kit-0.24.0 lib/slack/block_kit/layout/rich_text/rich_text_elements.rb