title: Adding several items to a Hash in Ruby
body: <p>I am a ruby beginner and I'm to create my own console-twitter for which whenever a user tweets, the app stores de tweet in a hash.</p>
  
  <p>Initially I was able to successfully do this by using</p>
  
  <pre><code>timeline = []
  
  puts "Write your tweet"
  
  newTweet = gets.chomp
  
  date =DateTime.now.strftime("%d/%m/%Y %H%:%M")
  
  @timeline &lt;&lt; { :timestamp =&gt; date , :tweet =&gt; newTweet  }
  </code></pre>
  
  <p>However I was told that by using => i'm using old ruby standars so I want to enhance it by using the below code:</p>
  
  <pre><code>@timeline &lt;&lt; { timestamp: date , tweet: newTweet  }
  </code></pre>
  
  <p>Unfortunately I get the following error message for that line of code: <strong>syntax error, unexpected ':', expecting '='</strong></p>
  
  <p>Also I'm having doubts on how should i declare the variable timeline</p>
  
  <pre><code>@timeline = []
  @timeline = {}
  @timeline = Hash.new
  </code></pre>
  
  <p>Many thanks in advance.</p>