deck-of-cards 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,11 @@
1
- Card = Struct.new :rank, :suit do
1
+ class Card
2
2
  include Comparable
3
+
4
+ attr_reader :rank, :suit
5
+
6
+ def initialize rank, suit
7
+ @rank, @suit = rank, suit
8
+ end
3
9
 
4
10
  def <=> other_card
5
11
  self.value <=> other_card.value
@@ -23,4 +29,8 @@ Card = Struct.new :rank, :suit do
23
29
  def to_s
24
30
  "#{rank} of #{suit}"
25
31
  end
32
+
33
+ def inspect
34
+ "<#{rank} of #{suit}>"
35
+ end
26
36
  end
@@ -1,3 +1,3 @@
1
1
  class DeckOfCards
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deck-of-cards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: