Skip to content

Instantly share code, notes, and snippets.

@rileydutton
Created March 8, 2013 19:36
Show Gist options
  • Save rileydutton/5119182 to your computer and use it in GitHub Desktop.
Save rileydutton/5119182 to your computer and use it in GitHub Desktop.
Fix
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