cards_lib 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cards_lib/deck.rb +3 -2
- data/lib/cards_lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73d586f222c4bd055aa9b0ec6cb38c229b59720
|
4
|
+
data.tar.gz: 6d4e6ef04c726373a4357ec23b9f09f64df24351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8b51c87c5112c8e613133ed0f54c5a01d479b93f3e297276daed456008244828003e2ab239cc9a8eeb300801a0f06863b1f4cbe50796e949f4896d5b8d01af3
|
7
|
+
data.tar.gz: 2d42c8518f4639e562985b1a2653e9f82ed01db1a4226d7d5db38e98288ab93e715e1b6ec1288057043c73581ae6c9d9cc42ee732db67ff8c51741cbef1251b9
|
data/lib/cards_lib/deck.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module CardsLib
|
2
2
|
class Deck
|
3
|
-
def initialize(
|
4
|
-
|
3
|
+
def initialize(options = {})
|
4
|
+
cards = options.fetch(:cards) { Standard::PLAYING_CARDS }
|
5
|
+
@seed = options.fetch(:seed) { Random.new.seed }
|
5
6
|
@top = 0
|
6
7
|
@cards = cards.map {|c| Card.new(c) }.shuffle(random: Random.new(@seed)).to_enum
|
7
8
|
end
|
data/lib/cards_lib/version.rb
CHANGED