Class: BubBot::Slack::Response
- Inherits:
-
Object
- Object
- BubBot::Slack::Response
- Defined in:
- lib/bub_bot/slack/response.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #channel ⇒ Object
- #deliver ⇒ Object
-
#initialize(options, client) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(options, client) ⇒ Response
Returns a new instance of Response.
4 5 6 7 |
# File 'lib/bub_bot/slack/response.rb', line 4 def initialize(, client) @text = .is_a?(String) ? : [:text] @client = client end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
2 3 4 |
# File 'lib/bub_bot/slack/response.rb', line 2 def text @text end |
Instance Method Details
#channel ⇒ Object
18 19 20 |
# File 'lib/bub_bot/slack/response.rb', line 18 def channel BubBot.configuration.slack_channel end |
#deliver ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/bub_bot/slack/response.rb', line 9 def deliver body = { text: text, username: BubBot.configuration.bot_name } # TODO: configure channel @client.chat_postMessage(channel: '#' + channel, text: text, as_user: true) end |