Sha256: 4f253e10fa73a9c0e9771e19b56f2e969cb1a111f8204ffe678cc082585b6900

Contents?: true

Size: 680 Bytes

Versions: 4

Compression:

Stored size: 680 Bytes

Contents

# encoding: utf-8

require 'monitor'
require 'thread_safe'

require 'memoizable/instance_methods'
require 'memoizable/method_builder'
require 'memoizable/module_methods'
require 'memoizable/memory'
require 'memoizable/version'

# Allow methods to be memoized
module Memoizable
  include InstanceMethods

  # Default freezer
  Freezer = lambda { |object| object.freeze }.freeze

  # Hook called when module is included
  #
  # @param [Module] descendant
  #   the module or class including Memoizable
  #
  # @return [self]
  #
  # @api private
  def self.included(descendant)
    super
    descendant.extend(ModuleMethods)
  end
  private_class_method :included

end # Memoizable

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
memoizable-0.4.2 lib/memoizable.rb
memoizable-0.4.1 lib/memoizable.rb
memoizable-0.4.0 lib/memoizable.rb
memoizable-0.3.1 lib/memoizable.rb