DEV Community

Diggin through hashes and arrays in Ruby

Prathamesh Sonpatki on March 18, 2020

While working with third party APIs, lot of times we get nested JSON structure in the response. Here is sample response from GitHub API. [ ...
Collapse
 
burdettelamar profile image
Burdette Lamar

Thanks, Prathamesh.

The nested objects may include any that respond to #dig,
which includes instances of:

  • Hash
  • Array
  • Struct
  • OpenStruct
  • CSV::Table
  • CSV::Row
Collapse
 
prathamesh profile image
Prathamesh Sonpatki

Nice! Thanks Burdette! Didn't know that.