Sha256: 5a7559175012f64a9de1d60d155330366af74dcc3be510f28fc837385d6a2a3e
Contents?: true
Size: 714 Bytes
Versions: 4
Compression:
Stored size: 714 Bytes
Contents
module CoreExtensions module Module RUBY_VERSION_18 = !!(RUBY_VERSION =~ /^1\.8/) def const_get_if_defined const args = RUBY_VERSION_18 ? [const] : [const, false] const_get(*args) if const_defined?(*args) end def const_remove_if_defined const remove_const const if const_defined? const end def const_get_or_set const const_get_if_defined(const) || const_set(const, yield) end def add_set_modules list Array(list).each do |mod| include mod if mod.instance_methods.any? || mod.respond_to?(:included) if (class_methods = mod.const_get_if_defined(:ClassMethods)) extend class_methods end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems