I looked into different resources and still get confused on how to parse a json format to a custom object, for example
class Resident attr_accessor :phone,
The following code is more simple:
require 'json' data = JSON.parse(json_data) residents = data['Resident'].map { |rd| Resident.new(rd['phone'], rd['addr']) }