README.md in twilio-ruby-3.10.1 vs README.md in twilio-ruby-3.11.0
- old
+ new
@@ -3,23 +3,21 @@
## Install
Via rubygems.org:
+```bash
+gem install twilio-ruby
```
-$ gem install twilio-ruby
-```
To build and install the development branch yourself from the latest source:
+```bash
+git clone git@github.com:twilio/twilio-ruby.git
+cd twilio-ruby
+make install
```
-$ git clone git@github.com:twilio/twilio-ruby.git
-$ cd twilio-ruby
-$ git checkout develop
-$ rake gem
-$ gem install pkg/twilio-ruby-{version}
-```
## Getting Started With REST
### Setup Work
@@ -36,26 +34,36 @@
```
### Send an SMS
``` ruby
-# send an sms
-@client.account.sms.messages.create(
+@client.account.messages.create(
:from => '+14159341234',
:to => '+16105557069',
:body => 'Hey there!'
)
```
+### Send an MMS
+
+``` ruby
+@client.account.messages.create(
+ :from => '+14159341234',
+ :to => '+16105557069',
+ :body => 'Hey there!',
+ :media_url => 'http://example.com/smileyface.jpg',
+)
+```
+
### Do Some Stuff With Calls
``` ruby
# make a new outgoing call
@call = @client.account.calls.create(
:from => '+14159341234',
:to => '+18004567890',
- :url => 'http://example.com/call-handler'
+ :url => 'http://example.com/call-handler',
)
# hangup a ringing call, but don't touch it if it's connected
@call.cancel
@@ -67,10 +75,17 @@
# hangup a call, no matter whether it is ringing or connected
@call.hangup
```
+### List Calls after a certain time
+
+``` ruby
+# list calls made or received on or after May 13, 2013
+@client.account.calls.list("start_time>" => "2013-05-13") # Notice we omit the "=" in the "start_time>=" parameter because it is automatically added
+```
+
### Buy a Phone Number
``` ruby
# print some available numbers
@numbers = @client.account.available_phone_numbers.get('US').local.list(
@@ -121,11 +136,11 @@
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'
# build up a response
response = Twilio::TwiML::Response.new do |r|
- r.Say 'hello there', :voice => 'woman'
+ r.Say 'hello there', :voice => 'alice'
r.Dial :callerId => '+14159992222' do |d|
d.Client 'jenny'
end
end
@@ -136,10 +151,10 @@
This will print the following (except for the whitespace):
```
<?xml version="1.0" encoding="UTF-8"?>
<Response>
- <Say voice="woman">hello there</Say>
+ <Say voice="alice">hello there</Say>
<Dial callerId="+14159992222">
<Client>jenny</Client>
</Dial>
</Response>
```