README.md in ably-0.7.6 vs README.md in ably-0.8.0

- old
+ new

@@ -1,16 +1,16 @@ -# [Ably](https://ably.io) +# [Ably](https://www.ably.io) [![Build Status](https://travis-ci.org/ably/ably-ruby.png)](https://travis-ci.org/ably/ably-ruby) [![Gem Version](https://badge.fury.io/rb/ably.svg)](http://badge.fury.io/rb/ably) [![Coverage Status](https://coveralls.io/repos/ably/ably-ruby/badge.svg)](https://coveralls.io/r/ably/ably-ruby) -A Ruby client library for [ably.io](https://ably.io), the realtime messaging service. +A Ruby client library for [ably.io](https://www.ably.io), the realtime messaging service. ## Documentation -Visit https://ably.io/documentation for a complete API reference and more examples. +Visit https://www.ably.io/documentation for a complete API reference and more examples. ## Installation The client library is available as a [gem from RubyGems.org](https://rubygems.org/gems/ably). @@ -39,11 +39,15 @@ ``` All examples assume a client has been created as follows: ```ruby +# basic auth with an API key client = Ably::Realtime.new(key: 'xxxxx') + +# using token auth +client = Ably::Realtime.new(token: 'xxxxx') ``` ### Connection Successful connection: @@ -176,22 +180,22 @@ ``` ### Generate Token and Token Request ```ruby -client.auth.request_token -# => #<Ably::Models::Token ...> +token_details = client.auth.request_token +# => #<Ably::Models::TokenDetails ...> +token_details.token # => "xVLyHw.CLchevH3hF....MDh9ZC_Q" +client = Ably::Rest.new(token: token_details.token) token = client.auth.create_token_request # => {"id"=>..., # "clientId"=>nil, # "ttl"=>3600, # "timestamp"=>..., # "capability"=>"{\"*\":[\"*\"]}", # "nonce"=>..., # "mac"=>...} - -client = Ably::Rest.new(token_id: token.id) ``` ### Fetching your application's stats ```ruby