I have an array of hashes titled entities
Here is a look at the array:
p "entities"
y entities
p "entities[0]"
y entities[0]
p "entities[1]"
y entities[1]
p "entities[2]"
y entities[2]
Output:
"entities"
--- |
---
- :text: Berlin
:links:
- http://dbpedia.org/resource/Berlin
- :text: Jan Karski
:links:
- http://dbpedia.org/resource/Jan_Karski
- :text: God
:links:
- http://dbpedia.org/resource/God
"entities[0]"
--- "-"
"entities[1]"
--- "-"
"entities[2]"
--- "-"
I can’t figure out how to access the individual hashes. Should something be coming up when I do p entities[0]?
Is
entities.kind_of? Stringtrue? It looks like entities is actually a YAML string. Hence, entities[0/1/2] are the first three dashes of the YAML.