Methods

Files

Class/Module Index [+]

Quicksearch

Kernel

Public Instance Methods

const_lookup(c) click to toggle source
# File lib/mspec/helpers/const_lookup.rb, line 2
def const_lookup(c)
  names = c.split '::'
  names.shift if names.first.empty?
  names.inject(Object) do |m, n|
    defined = RUBY_VERSION =~ /^1.9/ ? m.const_defined?(n, false) : m.const_defined?(n)
    defined ? m.const_get(n) : m.const_missing(n)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.