Class: Slack::BlockKit::Layout::RichText::RichTextElements::Usergroup
- Inherits:
-
Object
- Object
- Slack::BlockKit::Layout::RichText::RichTextElements::Usergroup
- Includes:
- StyleHelper
- Defined in:
- lib/slack/block_kit/layout/rich_text/rich_text_elements/usergroup.rb
Overview
Constant Summary collapse
- TYPE =
'usergroup'
- VALID_STYLES =
%w[bold italic strike highlight client_highlight unlink].freeze
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(usergroup_id:, styles: []) ⇒ Usergroup
constructor
A new instance of Usergroup.
Methods included from StyleHelper
#styles_as_json, #validate_styles
Constructor Details
#initialize(usergroup_id:, styles: []) ⇒ Usergroup
Returns a new instance of Usergroup.
14 15 16 17 18 |
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements/usergroup.rb', line 14 def initialize(usergroup_id:, styles: []) @usergroup_id = usergroup_id @styles = styles validate_styles(styles, VALID_STYLES) end |
Instance Method Details
#as_json ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/slack/block_kit/layout/rich_text/rich_text_elements/usergroup.rb', line 20 def as_json(*) { type: TYPE, usergroup_id: @usergroup_id, style: styles_as_json(@styles) }.compact end |