method

each_const

v1_9_2_180 - Show latest stable - Class: OptionParser
each_const(path, base = ::Object)
public

No documentation available.

# File lib/optparse/version.rb, line 49
  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
        c = klass.const_get(c)
      end
    end
  end