Ho una matrice simile a questa.Ruby Accessing Array Elements
[{"EntryId"=>"2", "Field1"=>"National Life Group","DateCreated"=>"2010-07-30 11:00:14", "CreatedBy"=>"tristanoneil"},
{"EntryId"=>"3", "Field1"=>"Barton Golf Club", "DateCreated"=>"2010-07-30 11:11:20", "CreatedBy"=>"public"},
{"EntryId"=>"4", "Field1"=>"PP&D Brochure Distribution", "DateCreated"=>"2010-07-30 11:11:20", "CreatedBy"=>"public"},
{"EntryId"=>"5", "Field1"=>"Prime Renovation Group, DreamMaker Bath & Kitchen", "DateCreated"=>"2010-07-30 11:11:21", "CreatedBy"=>"public"}
]
Come posso fare per l'iterazione attraverso questa serie in modo da poter specificare quale campo voglio stampare e ottenere il valore, così ho potuto fare qualcosa di simile.
puts EntryId.value
Questo ha funzionato brillantemente. –
Ho un problema simile ma quando uso 'entry [" EntryId "]' Non riesco a convertire la stringa in numero intero (TypeError) ' –