joncodo / Crib

A crib engine to play the card game crib with AI and a card counter
3 stars 2 forks source link

card.rb: refactor display_value to to_s. #4

Closed scott-steadman closed 10 years ago

scott-steadman commented 10 years ago

Reason: to_s is ruby's idiomatic way of representing a class as a string.

Get rid of the display_value field, and add a to_s method that does the same thing.

def to_s
  "#{number}-#{suit}"
end
joncodo commented 10 years ago

@ss Thanks for all the great feedback. Ill get right on these. Got any input on the tests?

scott-steadman commented 10 years ago

I'll take a look at the tests later. When I get a chance.

scott-steadman commented 10 years ago

Moved to #2