Skip to content

Commit

Permalink
Release 0.3.0
Browse files Browse the repository at this point in the history
- Update README
- Bump travis tests to latest ruby versions
  • Loading branch information
mauricew committed Jun 17, 2018
1 parent edb8c2d commit be2a951
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
sudo: false
language: ruby
rvm:
- 2.3.6
- 2.4.3
- 2.3.7
- 2.4.4
- 2.5.1
env:
- TWITCH_CLIENT_ID=test
before_install: gem install bundler -v 1.16.0
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Gem](https://img.shields.io/gem/v/twitch-api.svg)]()
[![Downloads](https://img.shields.io/gem/dt/twitch-api.svg)]()
[![Travis](https://img.shields.io/travis/mauricew/ruby-twitch-api.svg)]()
[![Gem](https://img.shields.io/gem/v/twitch-api.svg)](https://rubygems.org/gems/twitch-api)
[![Downloads](https://img.shields.io/gem/dt/twitch-api.svg)](https://rubygems.org/gems/twitch-api)
[![Travis](https://img.shields.io/travis/mauricew/ruby-twitch-api.svg)](https://travis-ci.org/mauricew/ruby-twitch-api)
[![License](https://img.shields.io/github/license/mauricew/ruby-twitch-api.svg)]()
# Ruby Twitch API

Expand All @@ -13,6 +13,7 @@ Guaranteed supported APIs include:
* Helix Webhooks (coming soon)

The future may bring:
* Authentication
* PubSub
* TMI/chat

Expand Down Expand Up @@ -43,14 +44,17 @@ Or install it yourself as:
## Usage
A client must be initialized with your client ID or bearer access token.
```
client = Twitch::Client.new client_id: "YOUR_CLIENT_ID"
client = Twitch::Client.new(client_id: "YOUR_CLIENT_ID")
# or
client = Twitch::Client.new access_token: "YOUR_ACCESS_TOKEN"
client = Twitch::Client.new(access_token: "YOUR_ACCESS_TOKEN")
```
The retrieval methods take in a hash equal to the parameters of the API endpoint, and return a response object containing the data and other associated request information:
Because data may change for certain endpoints, there is also a keyword parameter called `with_raw` that returns the raw response for any request called.

Retrieval methods take in a hash equal to the parameters of the API endpoint, and return a response object containing the data and other associated request information:
* **data** is the data you would get back. Even if it's an array of one object, it remains the same as what comes from the API.
* **rate_limit** and associated fields contain API request limit information. Clip creation counts for a second limit (duration currently unknown).
* **pagination** is an hash that appears when data can be traversed, and contains one member (*cursor*) which lets you pagniate through certain requests.
* **pagination** is a hash that appears when data can be traversed, and contains one member (*cursor*) which lets you pagniate through certain requests.
* **raw** is the raw HTTP response data when `with_raw` is true in the client.
```
# Get top live streams
client.get_streams.data
Expand Down
2 changes: 1 addition & 1 deletion lib/twitch/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Twitch
# Library version.
VERSION = "0.2.0"
VERSION = "0.3.0"
end

0 comments on commit be2a951

Please sign in to comment.