Skip to content

Commit

Permalink
Change prepend MemoWise to extend MemoWise
Browse files Browse the repository at this point in the history
Co-authored-by: Jemma Issroff <[email protected]>
  • Loading branch information
paracycle and jemmaissroff committed Dec 15, 2021
1 parent a2f87b0 commit 881beaa
Show file tree
Hide file tree
Showing 20 changed files with 414 additions and 657 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Or install it yourself as:

## Usage

When you `prepend MemoWise` within a class or module, `MemoWise` exposes three
When you `extend MemoWise` within a class or module, `MemoWise` exposes three
methods:

- [`memo_wise`](https://rubydoc.info/github/panorama-ed/memo_wise/MemoWise#memo_wise-class_method)
Expand All @@ -50,7 +50,7 @@ methods:

```ruby
class Example
prepend MemoWise
extend MemoWise

def slow_value(x)
sleep x
Expand Down Expand Up @@ -86,7 +86,7 @@ The same three methods are exposed for class methods as well:

```ruby
class Example
prepend MemoWise
extend MemoWise

def self.class_slow_value(x)
sleep x
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def benchmark_name
# NOTE: Some gems do not yet work in Ruby 3 so we only test with them if they've
# been `require`d.
BENCHMARK_GEMS = [
BenchmarkGem.new(MemoWise, "prepend MemoWise", :memo_wise),
BenchmarkGem.new(MemoWise, "extend MemoWise", :memo_wise),
(BenchmarkGem.new(DDMemoize, "DDMemoize.activate(self)", :memoize) if defined?(DDMemoize)),
(BenchmarkGem.new(Dry::Core, "include Dry::Core::Memoizable", :memoize) if defined?(Dry::Core)),
(BenchmarkGem.new(Memery, "include Memery", :memoize) if defined?(Memery)),
Expand Down
Loading

0 comments on commit 881beaa

Please sign in to comment.