tropo-rest 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tropo-rest.rb +14 -6
- data/lib/tropo-rest/version.rb +1 -1
- metadata +2 -2
data/lib/tropo-rest.rb
CHANGED
@@ -29,7 +29,7 @@ module TropoREST
|
|
29
29
|
class API
|
30
30
|
include HTTParty
|
31
31
|
|
32
|
-
cattr_accessor :logger, :voice_token, :messaging_token
|
32
|
+
cattr_accessor :logger, :voice_token, :messaging_token, :troplets_voice_token, :troplets_messaging_token
|
33
33
|
|
34
34
|
base_uri 'https://api.tropo.com'
|
35
35
|
SESSION_URI = '/1.0/sessions'
|
@@ -63,11 +63,7 @@ module TropoREST
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def options_with_token(options, type = :voice)
|
66
|
-
token
|
67
|
-
when :messaging then messaging_token
|
68
|
-
else voice_token
|
69
|
-
end
|
70
|
-
options.merge! token: token
|
66
|
+
options.merge! token: type == :messaging ? messaging_token : voice_token
|
71
67
|
end
|
72
68
|
end
|
73
69
|
end
|
@@ -83,6 +79,18 @@ module TropoREST
|
|
83
79
|
logger.debug "Troplet#say responded with: #{resp.inspect}"
|
84
80
|
resp
|
85
81
|
end
|
82
|
+
|
83
|
+
def voice_token=(token)
|
84
|
+
troplets_voice_token = token
|
85
|
+
end
|
86
|
+
|
87
|
+
def voice_token; troplets_voice_token; end
|
88
|
+
|
89
|
+
def messaging_token=(token)
|
90
|
+
troplets_messaging_token = token
|
91
|
+
end
|
92
|
+
|
93
|
+
def messaging_token; troplets_messaging_token; end
|
86
94
|
end
|
87
95
|
end
|
88
96
|
end
|
data/lib/tropo-rest/version.rb
CHANGED