module Objection::Inflector

Constants

NAMESPACE_SEPARTOR

Public Class Methods

constantize(string) click to toggle source
# File lib/motion-objection/inflector.rb, line 9
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
included(base) click to toggle source
# File lib/motion-objection/inflector.rb, line 5
def self.included(base)
  base.send :include, InstanceMethods
end