W
William Song
How can I properly define a struct in a class?
If I have
class Cards
Card = Struct.new
suit, :number)
@cardsOnHand=[]
@cardsOnHand.push(Card.new("S","5"))
end
This will give me an error message saying the push is not defined for
NilClass. How should I fix this?
If I have
class Cards
Card = Struct.new
@cardsOnHand=[]
@cardsOnHand.push(Card.new("S","5"))
end
This will give me an error message saying the push is not defined for
NilClass. How should I fix this?