module ConstEnhancements

AutoCamelize

This module enables a class to automatically map Ruby-esque snake_case method calls to the equivalent camelCase calls. If a method with a camelCase equivalent is found, we alias the snake_case method on the class, to avoid tripping method_missing for the same method in the future.

Public Instance Methods

const_descendants() click to toggle source
# File lib/docu_sign/extensions.rb, line 20
def const_descendants
  constants.reject { |c| c == 'Enumerator' }.inject([]) do |collection, constant|
    c = const_get(constant)
    collection << c

    if [Module, Class].include?(c.class)
      collection + c.const_descendants
    else
      collection
    end
  end
end