Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9165101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:50:10+00:00 2026-06-17T14:50:10+00:00

I can create an array of hashes: people = [ {Name => J.R. Kruger,

  • 0

I can create an array of hashes:

people = [
  {"Name" => "J.R. Kruger", "State" => "WA"},
  {"Name" => "Carl Hennings", "State" => "CA"}
]

Then I can use the each statement:

people.each { |p| puts p["Name"] }

and it will render a list of names as I expected.

"J.R. Kruger"
"Carl Hennings"

But, if I consume a web service of JSON objects that get parsed into an array of hashes:

speakers = JSON.parse(open("http://some.url.com/speakers.json").read)

It returns me an array of hashes. But, if I try and do the same thing as the above array of hashes representing people:

speakers.each {|s| puts s["SpeakerName"]}

It will only output the entire contents of speakers, which is an array of hashes and not the expected list of the "SpeakerName" key’s value for each hash in the array.

I should add that I can do:

speakers[0]["SpeakerName"] 

and get the desired results which ensures me that it’s not a wrong key.

What am missing?


UPDATED:

output from file:

[
  {
    "Title"=>"Working with Maps in iOS 6: MapKit and CoreLocation in Depth",
    "Abstract"=>"Adding a Map to an App and recording a User\u2019s location as they use the App has become a common must have feature in may of todays popular applications. This presentation will go over the updated iOS 6 APIs for accomplishing such tasks including map annotations, dragging and dropping custom pins as well as delve into some of the finer aspects of the required location based calculations one needs to consider to find the center of the map or the distance between two points. Additionally the presentation will go over techniques to update a MapView with a moving object as well as positioning the image for the object properly along its heading. This will be a straight forward hands on development presentation with plenty of code examples.",
    "Start"=>"2013-01-11T20:35:00Z",
    "Room"=>"Salon A",
    "Difficulty"=>"Intermediate",
    "SpeakerName"=>"Geoffrey Goetz",
    "Technology"=>"Mac/iPhone",
    "URI"=>"/api/sessions.json/Working-with-Maps-in-iOS-6-MapKit-and-CoreLocation-in-Depth",
    "EventType"=>"Session",
    "Id"=>"4f248d87-0e18-488d-8cef-5e4130b8bb20",
    "SessionLookupId"=>"Working-with-Maps-in-iOS-6-MapKit-and-CoreLocation-in-Depth",
    "SpeakerURI"=>"/api/speakers.json/Geoffrey-Goetz"
  },
  {
    "Title"=>"Vendor Sessions - Friday",
    "Start"=>"2013-01-11T20:00:00Z",
    "End"=>"2013-01-11T20:20:00Z",
    "Room"=>"TBD",
    "Difficulty"=>"Beginner",
    "SpeakerName"=>"All Attendees",
    "Technology"=>"Other",
    "URI"=>"/api/sessions.json/Vendor-Sessions--Friday",
    "EventType"=>"Session",
    "Id"=>"43720cb8-d8ca-4694-8806-debcbdefa239",
    "SessionLookupId"=>"Vendor-Sessions--Friday",
    "SpeakerURI"=>"/api/speakers.json/All-Attendees"
  },
  {
    "Title"=>"Vendor Sessions - Thursday",
    "Start"=>"2013-01-10T20:00:00Z",
    "End"=>"2013-01-10T20:20:00Z",
    "Room"=>"TBD",
    "Difficulty"=>"Beginner",
    "SpeakerName"=>"All Attendees",
    "Technology"=>"Other",
    "URI"=>"/api/sessions.json/Vendor-Sessions--Thursday",
    "EventType"=>"Session",
    "Id"=>"2df202e4-219c-4efb-a838-3898d183dd19",
    "SessionLookupId"=>"Vendor-Sessions--Thursday",
    "SpeakerURI"=>"/api/speakers.json/All-Attendees"
  },
  {
    "Title"=>"Version your database on nearly any platform with Liquibase",
    "Abstract"=>"If you are still writing one-off scripts to manage your database, then it is time to make your life much simpler and less error-prone.  \nWe'll spend the time discussing Liquibase, a tool that will help you to manage that process.  It will even allow you to check your schema and seed data into source-control, and get new environments up and running quickly.  This session will focus not on the merits of using such a tool, but on its workflow and implementation in a project.  We'll run through the majority of features from the command-line, demonstrating that as long as a Java Runtime Environment (jre) is available, Liquibase can be used during deployments on any platform.  We'll also touch on usage with maven and quirks of Liquibase that are good to know ahead of time.",
    "Start"=>"2013-01-11T20:35:00Z",
    "Room"=>"Sagewood/Zebrawood",
    "Difficulty"=>"Beginner",
    "SpeakerName"=>"Daniel Bower",
    "Technology"=>"Continuous Deployment",
    "URI"=>"/api/sessions.json/Version-your-database-on-nearly-any-platform-with-Liquibase",
    "EventType"=>"Session",
    "Id"=>"4abb3869-bacd-42e1-93dc-14e712090b65",
    "SessionLookupId"=>"Version-your-database-on-nearly-any-platform-with-Liquibase",
    "SpeakerURI"=>"/api/speakers.json/Daniel-Bower"
  }
]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:50:12+00:00Added an answer on June 17, 2026 at 2:50 pm

    The answer actually turned out to be exactly what I had suggested in my OP -> that the results is that Array#each returns the array.

    Therefore, it does post the same results in say (a view) when calling each on a instance variable it returns the entire array after the executing the block.

    See the Ruby Api docs for the source and how it returns the array which is the final returned result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an array of hashes of all the people I can
I can create and use dynamic two dimensional array in Fortran (in 77 standard).
I am trying to create an array of product SKU's which I can then
I have an array of hashes. Each entry looks like this: - !map:Hashie::Mash name:
Can't create array of coreGraphic gradient colors list I have an if statement for
Can c++ create array of pointers to different classes dynamically loaded from dll? ps.without
I can create an array of buttons in Windows Form but how can i
How can I create an array of namespaces? And because it seems like a
I can create a sparse php array (or map) using the command: $myarray =
How can I create a custom array constructor, which is an extended version of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.