Class: Slack::Surfaces::Home
- Inherits:
-
Object
- Object
- Slack::Surfaces::Home
- Defined in:
- lib/slack/surfaces/home.rb
Overview
The Home tab is a persistent, yet dynamic interface for apps that lives within the App Home.
api.slack.com/surfaces#tabs api.slack.com/reference/surfaces/views
Constant Summary collapse
- TYPE =
'home'
Instance Attribute Summary collapse
-
#blocks ⇒ Object
readonly
Returns the value of attribute blocks.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(blocks: nil, private_metadata: nil, callback_id: nil, external_id: nil) ⇒ Home
constructor
A new instance of Home.
Constructor Details
#initialize(blocks: nil, private_metadata: nil, callback_id: nil, external_id: nil) ⇒ Home
Returns a new instance of Home.
13 14 15 16 17 18 19 20 |
# File 'lib/slack/surfaces/home.rb', line 13 def initialize(blocks: nil, private_metadata: nil, callback_id: nil, external_id: nil) @blocks = blocks || Slack::BlockKit::Blocks.new @private_metadata = @callback_id = callback_id @external_id = external_id end |
Instance Attribute Details
#blocks ⇒ Object (readonly)
Returns the value of attribute blocks.
22 23 24 |
# File 'lib/slack/surfaces/home.rb', line 22 def blocks @blocks end |
Instance Method Details
#as_json ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/slack/surfaces/home.rb', line 24 def as_json(*) { type: TYPE, blocks: @blocks.as_json, private_metadata: @private_metadata, callback_id: @callback_id, external_id: @external_id }.compact end |