kylejginavan/youtube_it — pull request #146 by czak (2013-02-07 12:25:42+00:00)
Title: Accept an options Hash in #playlist

Previous implementation only accepted `playlist_id` and `order` Symbol parameter.

This prevented us from
* fetching more than the (default) 25 first videos
* fetching further video pages

I changed `#playlist` implementation to accept `playlist_id` and an `opts` Hash.

**Before**

```ruby
playlist = client.playlist('PLB821B8F9052B4E11', :position)
```

**After**

```ruby
playlist = client.playlist 'PLB821B8F9052B4E11',
{ 'orderby' => 'position' }
```

Most important change though: now `start-index` and `max-results` can be passed in the hash, e.g.

```ruby
playlist = client.playlist 'PLB821B8F9052B4E11',
{ 'orderby' => 'position',
'start-index' => 25,
'max-results' => 5 }
```

Note: this change is not backwards-compatible with code using the older
order parameter, but can be made so by verifying if the second parameter is a Hash or a Symbol