The default class that handles freezing objects
A freezer class for handling Object instances
Look up the Freezer descendant by object type
@example
freezer_class = IceNine::Freezer[mod]
@param [Module] mod
@return [Class<Freezer>]
@api public
# File lib/ice_nine/freezer.rb, line 27 def self.[](mod) @freezer_cache[mod] end
Look up a constant in the namespace
@param [String] namespace
@return [Module]
returned if a matching constant is found
@return [nil]
returned if no matching constant is found
@api private
# File lib/ice_nine/freezer.rb, line 60 def self.const_lookup(namespace) const_get(namespace) if const_defined?(namespace, nil) end
Find a Freezer descendant by name
@param [String] name
@return [Class<Freezer>]
returned if a matching freezer is found
@return [nil]
returned if no matching freezer is found
@api private
# File lib/ice_nine/freezer.rb, line 41 def self.find(name) freezer = name.split('::').reduce(self) do |mod, const| mod.const_lookup(const) or break mod end freezer if freezer < self # only return a descendant freezer end