Created
March 14, 2018 00:30
-
-
Save marcagas/6159bd91339a5b7d5a5254525e2b0e21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Num | |
extend Memoist | |
def sample_num | |
Random.rand(100) | |
end | |
memoize :sample_num | |
class << self | |
extend Memoist | |
def rand | |
Random.rand(100) | |
end | |
memoize :rand | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment