title: trying to build a card game that gives a hand of 5 cards in ruby
body: <pre><code>puts "Enter your a number:"
  
  class Card
  
    attr_accessor :rank, :suit
  
    def initialize(rank,suit)
      self.rank = rank
      self.suit = suit
    end  
  
  
    def output_card
      puts "#{self.rank} of #{self.suit}"
    end
  
  end  
  
  
  class Deck
  
    def initialize
      @cards = []  
      @ranks = [:A, 2, 3, 4, 5, 6, 7, 8, 9, 10, :J, :Q, :K]
      @suits = [:Spades, :Hearts, :Diamonds, :Clubs]    
  
      @suits.each do |suit|
        @ranks.each do |rank|
          @cards &lt;&lt; Card.new(rank, suit)  
        end 
      end   
    end  
  
    def shuffle 
      @cards.shuffle!
    end  
  
    def deal
      @cards.shift 
    end
  
  
  end 
  
  
  class Hand
  
      def initialize(deck)
         @hand = []
          5.times do
           @hand &lt;&lt; deck.deal
          end
      end
  
      def display_hand 
        @hand.each do |card|
           @hand.output_card
           end
  
      end      
  end
  
  
  
  
  hand = Hand.new 
  hand.display_hand
  puts hand
  </code></pre>
  
  <p>I'm trying to build a card game that outputs a hand of 5 cards. But I'm having trouble outputting the 5 cards. I keep getting this error: </p>
  
  <pre><code>card_game.rb:46:in `initialize': wrong number of arguments (given 0, expected 1) (ArgumentError)
      from card_game.rb:64:in `new'
      from card_game.rb:64:in `&lt;main&gt;'
  </code></pre>
  
  <p>When I call:</p>
  
  <pre><code>hand = Hand.new 
  hand.display_hand
  puts hand
  </code></pre>