title: Issue understanding Ruby error: undefined method `<<' for nil:NilClass (NoMethodError)
body: <p>I'm fairly new to Ruby and have tried to research this problem. Here is the code so far. I don't seem to have this problem calling the user object (user.deal_one(mydeck.deal_card)), but when I call it on the dealer I get this same error. The dealer object has the same instance variables and am unsure why it is calling on the method '&lt;&lt;'. </p>
  
  <p>Here is the full error: blackjackOOP.rb:32:in <code>deal_one': undefined method</code>&lt;&lt;' for nil:NilClass (NoMethodError)
      from blackjackOOP.rb:106:in `'</p>
  
  <pre><code>class Deck
    def initialize
      @deck = []
      @suit = ["Clubs", "Diamonds", "Hearts", "Spades"]
      @value = [2, 3, 4, 5, 6, 7, 8, 9, 10, "Jack", "Queen", "King", "Ace"]
      @count = 0
  
      @value.each do |x|
        @suit.each do |y|
          @deck[@count] = [x, y]
          @count += 1
        end
      end
      @deck.shuffle!
    end
  
    def deal_card
      @card = []
      @card &lt;&lt; @deck.pop
      @card
    end
  
    def show_deck_size
      puts @deck.size
    end
  end 
  
  module Hand
    def deal_one(card)
      @hand &lt;&lt; card
    end
  
    def total
      @total = 0
      @hand.each do |card|
        card.each do |val, suit|
          if val == "Jack" || val == "Queen" || val == "King"
            @total += 10
          elsif val != "Ace"
            @total += val
          elsif val == "Ace"
            if @total &gt; 10
              @total += 1
            else
              @total += 11
            end
          end
        end
      end
    end
  end
  
  class Player
    include Hand
  
    def initialize(name)
      @name = name
      @hand = []
    end
  
    def hit_stay
      puts "#{@name} has #{show_hand} for a total of #{@total}"
    end
  
    def show_hand
      @hand.each do |card|
        card.each do |val, suit|
          print "#{val} of #{suit} "
        end
      end
    end
  end
  
  class Dealer
    include Hand
  
    def initalize
      @name = "Dealer"
      @hand = []
    end
  end
  
  def say(n)
    puts "=&gt; #{n}"
  end
  
  
  
  say("Hello would you like to play some blackjack? Great!")
  say("What is your name?")
  name = gets.chomp
  
  mydeck = Deck.new
  user = Player.new(name)
  dealer = Dealer.new
  
  say("Welcome #{name}! Let's play!")
  
  
  #deal hands to dealer and player
  user.deal_one(mydeck.deal_card)
  user.deal_one(mydeck.deal_card)
  dealer.deal_one(mydeck.deal_card)
  </code></pre>