ahmetabdi/themoviedb — pull request #8 by rectifyer (2013-11-21 08:25:39+00:00)
Title: Set ETag header. Get response code and ETag.

This allows ETags to be set and read when making requests to the API. I tried to follow your convention for setting the ETag. For saving the response, I just stored it in a global hash in the API class. It seems some methods (i.e. detail) return the data in a different format then others (i.e. external_ids).

An example on how this can be used with getting a TV show's detail.

Tmdb::Api.etag('06f46301d9d424db1a91a2587ba9ab36')
Tmdb::TV.detail(1396)

Then you can check the responses with:

Tmdb::Api.response['code']
Tmdb::Api.response['etag']

Open to suggestions if you have a better way to approach this.