Class: Slackert::Blocks::BlockElement
- Inherits:
-
Object
- Object
- Slackert::Blocks::BlockElement
- Defined in:
- lib/slackert/blocks.rb
Overview
Abstract BlockElement. Subclass and override to_slack
to add a new block element.
Instance Method Summary collapse
-
#initialize(type) ⇒ BlockElement
constructor
A new instance of BlockElement.
-
#to_slack ⇒ Object
Returns a hash of the element, ready to be added to the block formatted message.
Constructor Details
#initialize(type) ⇒ BlockElement
Returns a new instance of BlockElement.
9 10 11 |
# File 'lib/slackert/blocks.rb', line 9 def initialize(type) @type = type end |
Instance Method Details
#to_slack ⇒ Object
Returns a hash of the element, ready to be added to the block formatted message. Abstract method that needs to be implemented in each subclassed element.
16 17 18 |
# File 'lib/slackert/blocks.rb', line 16 def to_slack raise NoMethodError, 'Override this implementation' end |