class IceNine::Freezer

The default class that handles freezing objects

Constants

BasicObject

A freezer class for handling Object instances

Public Class Methods

[](mod) click to toggle source

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

Protected Class Methods

const_lookup(namespace) click to toggle source

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

Private Class Methods

find(name) click to toggle source

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