Module: Ccls::CoreExtension

Defined in:
lib/ccls_engine/core_extension.rb

Instance Method Summary collapse

Instance Method Details

#class_exists?(full_class_name) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
11
# File 'lib/ccls_engine/core_extension.rb', line 3

def class_exists?(full_class_name)
	name_spaces = full_class_name.to_s.split('::')
	class_name = name_spaces.pop
	name_space = name_spaces.join('::')
	klass = ((name_space.blank?) ? Module : name_space.constantize).const_get(class_name.to_s)
	return klass.is_a?(Class)
rescue NameError
	return false
end