Created
March 8, 2013 19:36
-
-
Save rileydutton/5119182 to your computer and use it in GitHub Desktop.
Fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CLAIMS_MAP = { | |
| :expires => :exp, | |
| :notBefore => :nbf, | |
| :admin => :admin, | |
| :debug => :debug, | |
| :simulate => :simulate | |
| } | |
| def create_options_claims(options) | |
| opts = {} | |
| options.each do |key, value| | |
| if CLAIMS_MAP.include?(key.to_sym) then | |
| opts[CLAIMS_MAP[key.to_sym].to_sym] = value | |
| else | |
| raise ArgumentError, "#{key.to_s} is not a valid option" | |
| end | |
| end | |
| opts | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment