Class: Boty::Slack::Chat
Instance Attribute Summary collapse
-
#im ⇒ Object
readonly
Returns the value of attribute im.
Instance Method Summary collapse
-
#initialize ⇒ Chat
constructor
A new instance of Chat.
- #post_im(user_id, message) ⇒ Object
- #post_message(message, parameters = {}) ⇒ Object
Methods included from URL
Constructor Details
#initialize ⇒ Chat
Returns a new instance of Chat.
9 10 11 |
# File 'lib/boty/slack/chat.rb', line 9 def initialize @im = IM.new end |
Instance Attribute Details
#im ⇒ Object (readonly)
Returns the value of attribute im.
7 8 9 |
# File 'lib/boty/slack/chat.rb', line 7 def im @im end |
Instance Method Details
#post_im(user_id, message) ⇒ Object
22 23 24 25 |
# File 'lib/boty/slack/chat.rb', line 22 def post_im(user_id, ) channel = im.open user_id , channel: channel.id end |
#post_message(message, parameters = {}) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/boty/slack/chat.rb', line 13 def (, parameters = {}) defaults = { as_user: true, channel: "general", text: } URL.get parameterize(defaults.merge parameters) end |