Module: Kernel

Defined in:
lib/ruby_ext.rb

Instance Method Summary collapse

Instance Method Details

#using?(sym) ⇒ Boolean

Checks if a module is loaded without triggering autoload

Returns:

  • (Boolean)


121
122
123
124
# File 'lib/ruby_ext.rb', line 121

def using?(sym)
  return false if Object.autoload?(sym)
  return Object.const_defined?(sym)
end