Method: Watsbot::Message#send

Defined in:
lib/watsbot/message.rb

#send(uid, message, context = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/watsbot/message.rb', line 8

def send(uid, message, context={})
  raise "uid should be provided" and return if uid.nil? or uid.empty?
  raise "message should be provided" and return if message.nil? or message.empty?

  future = Celluloid::Future.new { call(uid, message, context={}) }
  future.value
end