README.md in twilio-ruby-5.26.0 vs README.md in twilio-ruby-5.27.0
- old
+ new
@@ -27,27 +27,31 @@
## Installation
To install using [Bundler][bundler] grab the latest stable version:
```ruby
-gem 'twilio-ruby', '~> 5.26.0'
+gem 'twilio-ruby', '~> 5.27.0'
```
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
```bash
-gem install twilio-ruby -v 5.26.0
+gem install twilio-ruby -v 5.27.0
```
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
```
+## Versions
+
+`twilio-ruby` uses a modified version of [Semantic Versioning](https://semver.org) for all changes. [See this document](VERSIONS.md) for details.
+
### Migration from 4.x
[Upgrade Guide][upgrade]
## Docker Image
@@ -76,55 +80,63 @@
```
### Make a Call
```ruby
-@client.api.account.calls.create(
+@client.calls.create(
from: '+14159341234',
to: '+16105557069',
url: 'http://example.com'
)
```
### Send an SMS
```ruby
-@client.api.account.messages.create(
+@client.messages.create(
from: '+14159341234',
to: '+16105557069',
body: 'Hey there!'
)
```
### List your SMS Messages
```ruby
-@client.api.account.messages.list
+@client.messages.list(limit: 20)
```
### Fetch a single SMS message by Sid
```ruby
# put the message sid you want to retrieve here:
message_sid = 'SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-@client.api.account.messages(message_sid).fetch
+@client.messages(message_sid).fetch
```
### Customizing your HTTP Client
-twilio-ruby uses [Faraday][faraday] to make HTTP requests. You can tell
-Twilio::REST::Client to use any of the Faraday adapters like so:
+`twilio-ruby` uses [Faraday][faraday] to make HTTP requests. You can tell `Twilio::REST::Client` to use any of the Faraday adapters like so:
```ruby
@client.http_client.adapter = :typhoeus
```
-## Getting Started With Client Capability Tokens
+### Handling Errors
-If you just need to generate a Capability Token for use with Twilio Client, you
-can do this:
+```ruby
+begin
+ messages = @client.messages.list(limit: 20)
+rescue Twilio::REST::TwilioError => e
+ puts e.message
+end
+```
+### Getting Started With Client Capability Tokens
+
+If you just need to generate a Capability Token for use with Twilio Client, you can do this:
+
```ruby
require 'twilio-ruby'
# put your own account credentials here:
account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
@@ -143,12 +155,11 @@
# generate the token string
@token = capability.to_s
```
-There is a slightly more detailed document in the [Capability][capability]
-section of the wiki.
+There is a slightly more detailed document in the [Capability][capability] section of the wiki.
### Generating TwiML
To control phone calls, your application needs to output [TwiML][twiml].
@@ -180,16 +191,14 @@
</Response>
```
## Supported Ruby Versions
-This library supports and is [tested against][travis] the following Ruby
-implementations:
+This library supports and is [tested against][travis] the following Ruby implementations:
-- Ruby 2.5.0
-- Ruby 2.4.0
-- Ruby 2.3.0
-- Ruby 2.2.0
+- Ruby 2.6.X
+- Ruby 2.5.X
+- Ruby 2.4.X
[apidocs]: https://www.twilio.com/docs/api
[twiml]: https://www.twilio.com/docs/api/twiml
[libdocs]: https://www.twilio.com/docs/libraries/ruby
[refdocs]: https://twilio.github.io/twilio-ruby