/gist:1143cbf35ca2ea766725 Secret
Created
May 26, 2014 13:43
This file contains 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
namespace = options.fetch(:namespace, Object).name # V1 -> "V1 | |
resource_namespace = resource.class.name.deconstantize # "Doorkeeper::AcccessToken" -> "Doorkeeper" | |
_module = "#{namespace}::#{resource_namespace}".constantize # V1::Doorkeeper | |
_module.const_get "#{resource.class.name.demodulize}Serializer" # const_get "AccessTokenSerializer" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment