Check if module exists in Ruby
def module_exists?(name, base = self.class)
base.const_defined?(name) &&
base.const_get(name).instance_of?(::Module)
end
Written by Paweł Wilk
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#