Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Jul 4, 2022
1 parent 81d3d93 commit fefac6f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@

# rspec failure tracking
.rspec_status

*.gem
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Michie Changelog

## 0.x

### 0.2.0

- Support passing method names to `memoize`
- Use method type prefix to avoid instance variable name collisions

### 0.1.0

Initial release.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
[gem]: https://rubygems.org/gems/michie
[actions]: https://github.com/shioyama/michie/actions

Michie (pronounced /ˈmɪki/, like “Mickey”) memoizes methods defined in a block.
Unlike other meomization libraries, Michie encapsulates its memoization in
a single module which it prepends over the original method.
Michie (pronounced /ˈmɪki/, like “Mickey”) memoizes methods either passed by
method name or defined in a block. Unlike other meomization libraries, Michie
encapsulates its memoization in a single module which it prepends over the
original method.

## Usage

Expand All @@ -25,6 +26,22 @@ class BillingApi
end
end
end
```

Alternatively, you can pass the method name(s) to `memoize` after they have
been defined:

```ruby
class BillingApi
extend Michie

def fetch_aggregate_data
# returns all data from remote server
end
memoize :fetch_aggregate_data
end
```


api = BillingApi.new
api.fetch_aggregate_data
Expand Down
2 changes: 1 addition & 1 deletion lib/michie/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Michie
VERSION = "0.1.0"
VERSION = "0.2.0"
end

0 comments on commit fefac6f

Please sign in to comment.