Last active
December 24, 2015 07:40
-
-
Save ncdc/6765613 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
require 'json' | |
require 'active_support/hash_with_indifferent_access' | |
require 'active_support/core_ext/hash' | |
restart_output = {from_json: true, status: :success} | |
restart_output_json = JSON.dump(restart_output) | |
puts restart_output_json | |
# prints {"from_json":true,"status":"success"} | |
input = HashWithIndifferentAccess.new(JSON.load(restart_output_json)) | |
puts input[:status] | |
# prints 'success' | |
puts input[:status].class | |
# prints String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment