Last active
August 29, 2015 14:02
-
-
Save ohta-rh/9dbb5340e99c264df8c6 to your computer and use it in GitHub Desktop.
class instance method cached object sample
This file contains 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 Hoge | |
class << self | |
def store(identificate: identificate) | |
hoges[identificate] ||= hoges.store(identificate, Hoge.new) | |
end | |
def hoges | |
@hoges ||= {} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment