fork download
  1. response = {"tag"=>["one", "two", "three"], "name"=>"example"}
  2.  
  3. def get_formatted_response(response)
  4. name = response["name"]
  5. tags = response["tag"]
  6. new_list = []
  7.  
  8. tags.each do |tag|
  9. new_list << name + "-" + tag
  10. end
  11.  
  12. return new_list
  13. end
  14.  
  15. print get_formatted_response(response)
Success #stdin #stdout 0.06s 9696KB
stdin
Standard input is empty
stdout
["example-one", "example-two", "example-three"]