Class: RubyQuiz1::Deck

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ruby_quiz_1/deck.rb

Direct Known Subclasses

StandardDeck

Instance Method Summary collapse

Instance Method Details

#cardsObject



5
6
7
# File 'lib/ruby_quiz_1/deck.rb', line 5

def cards
  @cards ||= []
end

#eachObject



9
10
11
# File 'lib/ruby_quiz_1/deck.rb', line 9

def each
  cards.each { |card| yield card }
end

#sizeObject



13
14
15
# File 'lib/ruby_quiz_1/deck.rb', line 13

def size
  cards.size
end