-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed interfaces to be private, updated related code and tests. Imp…
…lemented getType for each interface to properly identify blocks, elements, and objects
- Loading branch information
1 parent
cc1779f
commit 45f072b
Showing
16 changed files
with
128 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
package slack | ||
|
||
import "strings" | ||
|
||
// DividerBlock for displaying a divider line between blocks (similar to <hr> tag in html) | ||
// | ||
// More Information: https://api.slack.com/reference/messaging/blocks#divider | ||
type DividerBlock struct { | ||
Type string `json:"type"` | ||
BlockID string `json:"block_id,omitempty"` | ||
Type MessageBlockType `json:"type"` | ||
BlockID string `json:"block_id,omitempty"` | ||
} | ||
|
||
// ValidateBlock ensures that the type set to the block is found in the list of | ||
// valid slack block. | ||
func (s *DividerBlock) ValidateBlock() bool { | ||
return isStringInSlice(validBlockList, strings.ToLower(s.Type)) | ||
|
||
// blockType returns the type of the block | ||
func (s DividerBlock) blockType() MessageBlockType { | ||
return s.Type | ||
} | ||
|
||
// NewDividerBlock returns a new instance of a divider block | ||
func NewDividerBlock() *DividerBlock { | ||
|
||
return &DividerBlock{ | ||
Type: "divider", | ||
Type: mbtDivider, | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.