Depending on the contents of the array, you may omit .present?. Ruby will also just take on the last value in such a construction, so you can omit the statement if.
@foursquare['response']['groups'][0] &&
@foursquare['response']['groups'][0]['items'] &&
@foursquare['response']['groups'][0]['items'][42]
egonil ( post), andand gem ( ) Ruby 2.3 .