method
each_const
v2_4_6 -
Show latest stable
- Class:
OptionParser
each_const(path, base = ::Object)public
No documentation available.
# File lib/optparse/version.rb, line 50
def each_const(path, base = ::Object)
path.split(/::|\//).inject(base) do |klass, name|
raise NameError, path unless Module === klass
klass.constants.grep(/#{name}/) do |c|
klass.const_defined?(c) or next
klass.const_get(c)
end
end
end