Class: Builtins::Helpers::Enumerator

Inherits:
Object
  • Object
show all
Defined in:
lib/builtins/helpers/enumerator.rb

Class Method Summary collapse

Class Method Details

.names_by_constantObject


7
8
9
10
11
12
13
14
15
# File 'lib/builtins/helpers/enumerator.rb', line 7

def names_by_constant
	constants_by_name.each_with_object({}) do |(name, const), hash|
		if hash.include?(const)
			hash[const] << name
		else
			hash[const] = [name]
		end
	end
end