query = 'select * from some_table'

cursor = session.exec(query)
while row = cursor.fetch
  puts row.join(",")
end
cursor.close
# Or with a block:
nrows = session.exec(query) do |row|
  puts row.join(",")
end

