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 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 = case type
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
@@ -1,3 +1,3 @@
1
1
  module TropoREST
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben Langfeld