card_deck 4.02 → 5.0.0.pre.345

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/card_deck/deck.rb +9 -14
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c17143169d2486efe6f38616842fdffdec57fc7deab4e4373f5d65dd709efd2
4
- data.tar.gz: 15d6c882b3a6787da7ff4798fdcb6d1b13a0a8918da79e9a9ed277b44fa07848
3
+ metadata.gz: 146bb58b79c3ea95cab6bb77a057034a198d83fd04ef16a246a74f6db1aeb9ec
4
+ data.tar.gz: af5db2a883a7cf16ec6988586e78dd0a4727eaabc5abec9776cb1a6978d5c058
5
5
  SHA512:
6
- metadata.gz: 434a27415718429ee5be7d08aec3a9fe74b28711e08d695b4056bf09d0958de9db6eee718c67a3438be0576d5b551dd71d8adebec0b7f2f459d9c0f2d387d2c6
7
- data.tar.gz: 6b4494b07513568fb92c3a1a1130bf36ed19ebf598c3a240fec2420598441fc2ede3e77f5eb123b8c8e50961426d0ba4b9f2b1f34032d19eadb170cc92a00afa
6
+ metadata.gz: 375ffe7aa9e1411681dd891ba4a727b717c6c380bdb196086d90115e72ed30c34507ec4a866bff0e0dfdcbf4cbfff49ce4d1fab9b3d31d9edf41507cf53c6996
7
+ data.tar.gz: 15d6c9f57dd0079fa6437c7b0ba27b89ad605a5a44d4893346d9a71cc69e5fca92225dd85b8bddf32ee1413564c05721dcea168c1a04cb460d5838d36186d5ad
@@ -3,22 +3,17 @@ module CardDeck
3
3
  def Deck(args=Hash.new(false))
4
4
  Deck.new args
5
5
  end
6
- class Deck # The deck
7
- attr_accessor :cards # @return [Array<Card>]
8
- def initialize(args=Hash.new(false)) # Creates a new Deck. Includes Jokers when parmeter args == {jokers: true}
9
- @cards = Array.new
6
+ class Deck < SimpleDelegator # The deck
7
+ def initialize(args=Hash.new(false)) # Creates a new Deck. Includes Jokers when parameter args == {jokers: true}
8
+ super(Array.new)
10
9
  Card::Suit.each do |suit|
11
- stock 'Ace', suit
12
- (2..10).each {|num| stock num, suit}
13
- stock 'Jack', suit
14
- stock 'Queen', suit
15
- stock 'King', suit
10
+ push Card.new('Ace', suit)
11
+ (2..10).each {|num| push Card.new(num, suit)}
12
+ push Card.new('Jack', suit)
13
+ push Card.new('Queen', suit)
14
+ push Card.new('King', suit)
16
15
  end
17
- 2.times {stock 'Joker'} if args[:jokers]
16
+ 2.times {push Card.new('Joker')} if args[:jokers]
18
17
  end
19
- private
20
- def stock(num, suit=Card::Suit.sample) # Creates a Card to add to Deck#cards
21
- @cards.push Card.new num, suit
22
- end
23
18
  end
24
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card_deck
3
3
  version: !ruby/object:Gem::Version
4
- version: '4.02'
4
+ version: 5.0.0.pre.345
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Perlmutter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -67,9 +67,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - ">="
70
+ - - ">"
71
71
  - !ruby/object:Gem::Version
72
- version: '0'
72
+ version: 1.3.1
73
73
  requirements: []
74
74
  rubyforge_project:
75
75
  rubygems_version: 2.7.4