twilio-ruby 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/examples.rb +4 -4
- data/lib/twilio-ruby/rest/client.rb +1 -1
- data/lib/twilio-ruby/twiml/response.rb +9 -0
- data/lib/twilio-ruby.rb +1 -0
- metadata +5 -5
- data/lib/twilio-ruby/twiml/verb.rb +0 -5
data/examples.rb
CHANGED
@@ -49,17 +49,17 @@ end
|
|
49
49
|
################ SMS MESSAGES ################
|
50
50
|
|
51
51
|
# print a list of sms messages (one http request)
|
52
|
-
@account.
|
52
|
+
@account.sms.messages.list({:date_sent => '2010-09-01'}).each do |sms|
|
53
53
|
puts sms.body
|
54
54
|
end
|
55
55
|
|
56
56
|
# print a particular sms message (one http request)
|
57
|
-
puts @account.
|
57
|
+
puts @account.sms.messages.get('SMXXXXXXXX').body
|
58
58
|
|
59
59
|
# send an sms
|
60
|
-
@account.
|
60
|
+
@account.sms.messages.create(:from => '+14159341234', :to => '+16105557069', :body => 'Hey there!')
|
61
61
|
# or, an alias
|
62
|
-
@account.
|
62
|
+
@account.sms.messages.send('+14159341234', '+16105557069', 'Hey there!')
|
63
63
|
|
64
64
|
################ PHONE NUMBERS ################
|
65
65
|
|
@@ -21,7 +21,7 @@ module Twilio
|
|
21
21
|
uri += '.json'
|
22
22
|
params = (args[0] && args[0] != {}) ? twilify(args[0]) : nil
|
23
23
|
uri += "?#{url_encode(params)}" if params && method == :get
|
24
|
-
request = method_class.new uri
|
24
|
+
request = method_class.new uri, {'User-Agent' => 'twilio-ruby/0.2.1'}
|
25
25
|
request.basic_auth @account_sid, @auth_token
|
26
26
|
request.form_data = params if params && [:post, :put].include?(method)
|
27
27
|
http_response = @connection.request request
|
data/lib/twilio-ruby.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Benton
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-14 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -91,7 +91,7 @@ files:
|
|
91
91
|
- lib/twilio-ruby/rest/available_phone_numbers/toll_free.rb
|
92
92
|
- lib/twilio-ruby/rest/sandbox/sandbox.rb
|
93
93
|
- lib/twilio-ruby/rest/instance_resource.rb
|
94
|
-
- lib/twilio-ruby/twiml/
|
94
|
+
- lib/twilio-ruby/twiml/response.rb
|
95
95
|
- test/twilio_spec.rb
|
96
96
|
- test/test_twilio.rb
|
97
97
|
- examples.rb
|