Flowdock
method

const_missing

Importance_0
Ruby latest stable (v1_9_3_392) - 0 notes - Class: Digest
const_missing(name) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File ext/digest/lib/digest.rb, line 4
  def self.const_missing(name) # :nodoc:
    case name
    when :SHA256, :SHA384, :SHA512
      lib = 'digest/sha2.so'
    else
      lib = File.join('digest', name.to_s.downcase)
    end

    begin
      require lib
    rescue LoadError
      raise LoadError, "library not found for class Digest::#{name} -- #{lib}", caller(1)
    end
    unless Digest.const_defined?(name)
      raise NameError, "uninitialized constant Digest::#{name}", caller(1)
    end
    Digest.const_get(name)
  end
Register or log in to add new notes.