Skip to content

Instantly share code, notes, and snippets.

@ryanckulp
Created August 29, 2021 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanckulp/25cf5e066edcac5437435f32fb7bf880 to your computer and use it in GitHub Desktop.
Save ryanckulp/25cf5e066edcac5437435f32fb7bf880 to your computer and use it in GitHub Desktop.
# 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