Method: Sunspot::Util.full_const_get
- Defined in:
- lib/sunspot/util.rb
.full_const_get(string) ⇒ Object
Get a constant from a fully qualified name
Parameters
- string<String>
-
The fully qualified name of a constant
Returns
- Object
-
Value of constant named
83 84 85 86 87 |
# File 'lib/sunspot/util.rb', line 83 def full_const_get(string) string.split('::').inject(Object) do |context, const_name| context.const_defined?(const_name) ? context.const_get(const_name) : context.const_missing(const_name) end end |