matthewrudy / memoist

ActiveSupport::Memoizable with a few enhancements
MIT License
920 stars 99 forks source link

Support to see if a method has been memoized for a parameter + method combination #62

Open dahnny012 opened 7 years ago

dahnny012 commented 7 years ago

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