Class: Watsbot::Message

Inherits:
BaseResource show all
Includes:
HTTParty
Defined in:
lib/watsbot/message.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#config, #logger

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, 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