ruby-uebungen/Assignment_024/solution
Thomas Smits 25d5ac7ffd Initial commit 2023-05-23 09:19:31 +02:00
..
readme.md Initial commit 2023-05-23 09:19:31 +02:00

readme.md

Lösung: Hashes und Blöcke

















































































```ruby class Cache def initialize(&callback) @data = {} @callback = callback end

def add(key, value) @data[key] = value end

def @data[key] = @callback.call(key) unless @data.has_key?(key) @data[key] end end