title: ruby get value with input separate
body: <p>i am trying to get value from my get.chomp</p>
  
  <pre><code>total_user_input = []
  
  while true
      print "Input Name: "
      user_input = gets.chomp
      break if user_input.empty?
      total_user_input &lt;&lt; user_input
  end
  
  File.open("file.txt", "w") do |f|
  f.write(
    total_user_input.each do |input|
      f.print input
    end
  )
  </code></pre>
  
  <p>and the scirpt run like this:</p>
  
  <pre><code>Input Name: name:string
  Input Name: price:integer
  Input Name: description:date
  </code></pre>
  
  <p>and the result that i want is:</p>
  
  <pre><code>name: String
  price: Integer
  description: Date
  </code></pre>