Module: ConstEnhancements

Defined in:
lib/docusign/extensions.rb

Overview

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.

Instance Method Summary collapse

Instance Method Details

#const_descendantsObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/docusign/extensions.rb', line 10

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