Sha256: 4ee3a204957ecc9acc2c540ed29845a6cd430efa31ab28abf928c082a5df2138
Contents?: true
Size: 515 Bytes
Versions: 11
Compression:
Stored size: 515 Bytes
Contents
module Objection module Inflector NAMESPACE_SEPARTOR = "/" def self.included(base) base.send :include, InstanceMethods end def self.constantize(string) scopes = string.split(NAMESPACE_SEPARTOR).map { |x| x.split("_") }.map { |x| x.map { |y| y.capitalize }.join("") } scopes.inject(Object) do |const, name| const.const_get name end end module InstanceMethods def objection_constantize Inflector.constantize(self) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems