Class: Lita::Adapters::Slack::Attachment
- Inherits:
-
Object
- Object
- Lita::Adapters::Slack::Attachment
- Defined in:
- lib/lita/adapters/slack/attachment.rb
Overview
A Slack attachment object.
Instance Method Summary collapse
-
#initialize(text, **options) ⇒ Attachment
constructor
A new instance of Attachment.
-
#to_hash ⇒ Hash
Converts the attachment into a hash, suitable for being sent to the Slack API.
Constructor Details
#initialize(text, **options) ⇒ Attachment
Returns a new instance of Attachment.
15 16 17 18 |
# File 'lib/lita/adapters/slack/attachment.rb', line 15 def initialize(text, **) self.text = text self. = end |
Instance Method Details
#to_hash ⇒ Hash
Converts the attachment into a hash, suitable for being sent to the Slack API.
22 23 24 25 26 27 |
# File 'lib/lita/adapters/slack/attachment.rb', line 22 def to_hash .merge({ fallback: [:fallback] || text, text: text, }) end |