Module: ConstEnhancements
- Defined in:
- lib/docu_sign/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_descendants ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# 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 |