On Aug 25, 3:21 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Grep-ing through source is plainly a crap way.

j/k ;)

> Having "memoize :foo" store the fact that :foo is :memoized will;
> a) allow me to spec against it
> b) stop the "unmemoize_all" code having to grep through
> instance_methods

How does it stop unmemoize_all from looking for __memoized methods?
You've just delegated the responsibility.

> > memoization *is* an implementation detail. The helper should not be
> > treated any different than
>
> > def foo
> >   @foo ||= 1 + 1
> > end
>
> Indeed,
> except you get extra stuff in there for free, like reloading,
> and it claims to take care of arguments.
> (although I worry that any function like do_something(true) will
> instead just unmemoize itself)

So how would you test this simple memoized method? However you answer,
that is how you should test it will the memoize helper.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to