Module: Cinch::Utilities::Kernel Private

Defined in:
lib/cinch/utilities/kernel.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0

Class Method Summary collapse

Class Method Details

.string_to_const(s) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Object)

Since:

  • 2.0.0



7
8
9
10
# File 'lib/cinch/utilities/kernel.rb', line 7

def self.string_to_const(s)
  return s unless s.is_a?(::String)
  s.split("::").inject(Kernel) {|base, name| base.const_get(name) }
end