Created
February 1, 2017 01:57
-
-
Save mmcdaris/89e7b561831a06bd14b60be3dfc17248 to your computer and use it in GitHub Desktop.
Dump to a file! Move some objs
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
# Fancy obj you want to share | |
hash = { | |
a: 1234, | |
b: %W(this that the other one man yo yoy oyoyoyo), | |
c: "Magic Pants Found!" | |
} | |
# dump and write to file | |
File.open("marsha_marsha_marsha", 'wb') { |f| f.write(Marshal.dump(hash)) } | |
# read file and load back to object | |
hash_from_file = Marshal.load(File.read("marsha_marsha_marsha")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment