Module: QualifiedConstUtils

Defined in:
activesupport/lib/active_support/core_ext/module/qualified_const.rb

Overview

– Allows code reuse in the methods below without polluting Module. ++

Class Method Summary collapse

Class Method Details

.names(path) ⇒ Object



11
12
13
# File 'activesupport/lib/active_support/core_ext/module/qualified_const.rb', line 11

def self.names(path)
  path.split('::')
end

.raise_if_absolute(path) ⇒ Object

Raises:



7
8
9
# File 'activesupport/lib/active_support/core_ext/module/qualified_const.rb', line 7

def self.raise_if_absolute(path)
  raise NameError.new("wrong constant name #$&") if path =~ /\A::[^:]+/
end