class RubyPlayingCards::Hand
Attributes
cards[RW]
player[RW]
Public Class Methods
new(cards, player)
click to toggle source
# File lib/ruby_playing_cards/hand.rb, line 6 def initialize(cards, player) @cards = cards @player = player end
Public Instance Methods
add_cards(cards)
click to toggle source
# File lib/ruby_playing_cards/hand.rb, line 11 def add_cards(cards) @cards << cards end
size()
click to toggle source
# File lib/ruby_playing_cards/hand.rb, line 15 def size @cards.size end
to_s()
click to toggle source
# File lib/ruby_playing_cards/hand.rb, line 19 def to_s puts "Player #{@player}: " @cards.map do |card| card.to_s end end