Module: Memoizable::InstanceMethods

### Home Classes Methods

### In Files

- lib/memoizable/instance_methods.rb

### Methods

- #freeze
- #memoize

### Class/Module Index

Quicksearch

- Memoizable
- Memoizable::InstanceMethods
- Memoizable::Memory
- Memoizable::MethodBuilder
- Memoizable::MethodBuilder::BlockNotAllowedError
- Memoizable::MethodBuilder::InvalidArityError
- Memoizable::ModuleMethods

No matching classes.

# Memoizable::InstanceMethods

Methods mixed in to memoizable instances

### Public Instance Methods

freeze() click to toggle source

Freeze the object

@example

    object.freeze  # object is now frozen

@return [Object]

@api public

    # File lib/memoizable/instance_methods.rb, line 15
    def freeze
      memoized_method_cache  # initialize method cache
      super
    end

memoize(data) click to toggle source

Sets a memoized value for a method

@example

    object.memoize(hash: 12345)

@param [Hash{Symbol => Object}] data

    the data to memoize

@return [self]

@api public

    # File lib/memoizable/instance_methods.rb, line 31
    def memoize(data)
      data.each { |name, value| memoized_method_cache[name] = value }
      self
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.