Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/svenfuchs/memoize

Simplistic memoization using instance variables
https://github.com/svenfuchs/memoize

Last synced: 12 days ago
JSON representation

Simplistic memoization using instance variables

Awesome Lists containing this project

README

        

# Memoize [![Build Status](https://travis-ci.org/svenfuchs/memoize.svg?branch=master)](https://travis-ci.org/svenfuchs/memoize)

Simplistic memoization using instance variables.

## Installation

```
gem install
```

## Usage

```ruby
require 'memoize'

class Obj
include Memoize

# on a separate line, after the method definition
def foo
# expensive operation
end
memoize :foo

# on one line, before the method definition
memoize def bar
# expensive operation
end
end
```