Class: Slack::Message
- Inherits:
-
Object
- Object
- Slack::Message
- Defined in:
- lib/slack/message.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #add_attachment(attachment) ⇒ Object
- #as_json ⇒ Object
-
#initialize(text, attachment = nil) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(text, attachment = nil) ⇒ Message
Returns a new instance of Message.
6 7 8 9 10 |
# File 'lib/slack/message.rb', line 6 def initialize(text, = nil) @text = text = [] << if end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
4 5 6 |
# File 'lib/slack/message.rb', line 4 def end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/slack/message.rb', line 3 def text @text end |
Instance Method Details
#add_attachment(attachment) ⇒ Object
12 13 14 |
# File 'lib/slack/message.rb', line 12 def () << end |
#as_json ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/slack/message.rb', line 16 def as_json hash = { text: text } (hash) unless .empty? hash end |