kaspth/tokie — pull request #1 by kaspth (2014-12-30 13:48:04+00:00)
Title: Implement basic Claims versioning through constants.

Let's make it easy to rev' our metadata in the future.

The versions are scoped to a class like V1, V2 etc. Introducing a new version requires adding a new class and updating the `latest_version` method.

The version still needs to be encoded in the header. I vote for a 'ver' key that stores a string, like this: `{ 'ver' => 'V1' }`. c/d?

Passing in the version to `TokenGenerator` probably isn't the way to go, but right now extracting the version from the header feels cumbersome. How can we make that easier or is there another way I'm missing?

I'm unsure if we should use `method_missing` here, but it does work :grin:

cc @jeremy @chancancode @rafaelfranca