Module: SimplyAuthorized::CoreExtension
- Defined in:
- lib/simply_authorized/core_extension.rb
Instance Method Summary collapse
Instance Method Details
#class_exists?(full_class_name) ⇒ Boolean
4 5 6 7 8 9 10 11 12 |
# File 'lib/simply_authorized/core_extension.rb', line 4 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 |