class TwentyOne::Hand

Attributes

cards[R]

Public Class Methods

new(cards = []) click to toggle source
# File lib/twenty_one/hand.rb, line 7
def initialize(cards = [])
        @cards = cards
end

Public Instance Methods

clear() click to toggle source
# File lib/twenty_one/hand.rb, line 11
def clear
        @cards = []
end
value() click to toggle source
# File lib/twenty_one/hand.rb, line 15
def value
        count = 0

        @cards.each do |card|
                count += card.value
        end

        count
end