Created
March 18, 2013 17:22
-
-
Save skatenerd/5189009 to your computer and use it in GitHub Desktop.
Wat
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 Foo < Hash | |
def initialize(input_hash) | |
self.class[input_hash] | |
end | |
end | |
Foo[{h: 22}] | |
# => {:h=>22} | |
Foo.new({h: 22}) | |
# => {} |
dadarek
commented
Mar 18, 2013
Your way seems to give "undefined method [] for Class Class"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment