Class: Watsbot::Message
- Inherits:
-
BaseResource
- Object
- BaseResource
- Watsbot::Message
- Includes:
- HTTParty
- Defined in:
- lib/watsbot/message.rb
Instance Attribute Summary
Attributes inherited from BaseResource
Instance Method Summary collapse
Methods inherited from BaseResource
#basic_auth, #headers, #initialize
Constructor Details
This class inherits a constructor from Watsbot::BaseResource
Instance Method Details
#send(uid, message, context = {}) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/watsbot/message.rb', line 8 def send(uid, , context={}) raise "uid should be provided" and return if uid.nil? or uid.empty? raise "message should be provided" and return if .nil? or .empty? future = Celluloid::Future.new { call(uid, , context={}) } future.value end |