matthewrudy/memoist — pull request #17 by matthewrudy (2014-06-01 15:46:38+00:00)
Title: Remove Array caching hack

Currently we write to the cache

``` ruby
if @cached_value.any?
@cached_value[0]
else
@cached_value = [perform]
end
```

and expire it
``` ruby
@cached_value = []
```

But as @JacobEvelyn pointed out, we can just use
```
if instance_variable_defined?("@cached_value")
@cached_value
else
@cached_value = perform
end
```

and expire it
```
remove_instance_variable("@cached_value")
```