Method: Seabright::ObjectBase::ClassMethods#deep_const_get

Defined in:
lib/redis_object/base.rb

#deep_const_get(const, base = nil) ⇒ Object



352
353
354
355
356
357
358
359
360
# File 'lib/redis_object/base.rb', line 352

def deep_const_get(const,base=nil)
  if Symbol === const
    const = const.to_s
  else
    const = const.to_str.dup
  end
  base ||= const.sub!(/^::/, '') ? Object : self
  const.split(/::/).inject(base) { |mod, name| mod.const_get(name) }
end