ga-dc / wdi5-project3

Project 3
0 stars 5 forks source link

[genius bar] Having trouble pulling hash values from api results #61

Closed keithknox closed 9 years ago

keithknox commented 9 years ago

I'm trying to get map coordinates from my api location results. => #

<BurstStruct::Burst:0x00000005974d20
 @hash=
  {"city"=>"Leesburg",
   "display_address"=>["19925 Hogback Mountain Rd", "Leesburg, VA 20175"],
   "geo_accuracy"=>8.0,
   "postal_code"=>"20175",
   "country_code"=>"US",
   "address"=>["19925 Hogback Mountain Rd"],
   "coordinate"=>
    {"latitude"=>39.0630645751953, "longitude"=>-77.6353988647461},
   "state_code"=>"VA"}>

I can pull the latitude and longitude when i pull from the first location, but when i try to do an each loop for all the locations, i get all the results. should i run a separate loop for these has results or is there an easier way?

the reason i ask is that i'd like to create an array of latitudes and longitudes so that i can pass them a map markers.

RobertAKARobin commented 9 years ago

@hash only contains one city, so there isn't a whole lot to loop over...?

keithknox commented 9 years ago

right, that's the first location that i can i use as an example. when i go to loop it over the others, i get all the results returned.