Class: TropoREST::Troplets

Inherits:
API
  • Object
show all
Defined in:
lib/tropo-rest.rb

Constant Summary

Constants inherited from API

API::SESSION_URI

Class Method Summary collapse

Methods inherited from API

fire_event, options_with_token, originate, request

Class Method Details

.messaging_tokenObject



93
# File 'lib/tropo-rest.rb', line 93

def messaging_token; self.troplets_messaging_token; end

.messaging_token=(token) ⇒ Object



89
90
91
# File 'lib/tropo-rest.rb', line 89

def messaging_token=(token)
  self.troplets_messaging_token = token
end

.say(to, message, options = {}) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/tropo-rest.rb', line 75

def say(to, message, options = {})
  logger.debug "Using Troplets to say #{message} to #{to}"
  options.merge! to: to, message: message
  resp = request '/say', options, options[:channel] == :voice ? :voice : :messaging
  logger.debug "Troplet#say responded with: #{resp.inspect}"
  resp
end

.voice_tokenObject



87
# File 'lib/tropo-rest.rb', line 87

def voice_token; self.troplets_voice_token; end

.voice_token=(token) ⇒ Object



83
84
85
# File 'lib/tropo-rest.rb', line 83

def voice_token=(token)
  self.troplets_voice_token = token
end