You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Book
class << self
extend memoist
def find(id)
if memoized value is nil
return operation
else
return memozied value
end
end
memoize :find
end
end
Book.find(3) # nil
Book.create!(id: 3)
Book.find(3) # should not hit the memoized value
The text was updated successfully, but these errors were encountered:
Ex.
class Book
class << self
extend memoist
def find(id)
if memoized value is nil
return operation
else
return memozied value
end
end
memoize :find
end
end
Book.find(3) # nil
Book.create!(id: 3)
Book.find(3) # should not hit the memoized value
The text was updated successfully, but these errors were encountered: