Created
August 29, 2021 08:41
-
-
Save ryanckulp/25cf5e066edcac5437435f32fb7bf880 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
# While in IRB, use the Ruby JSON library with: | |
require 'json' | |
# Then pass stringifed JSON content into it, surrounded by single quotes: | |
JSON.parse('stringified json here') | |
# In this lecture we learned a new Hash method: | |
hash.delete(:key_or_string) | |
# This will remove by the key AND the key's corresponding value from a hash. | |
# Example: | |
person = { name: "Ryan" } | |
person.delete(:name) | |
person # => {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment