Module: Liquidizer::Support

Defined in:
lib/liquidizer/support.rb

Class Method Summary collapse

Class Method Details

.constant_defined?(name) ⇒ Boolean

This is like Object.const_defined?, but works with namespaced constants (Foo::Bar::Baz).

Returns:

  • (Boolean)


4
5
6
7
8
# File 'lib/liquidizer/support.rb', line 4

def self.constant_defined?(name)
  name.constantize && true
rescue NameError
  false
end