class PlayingCards::Card

Constants

RANKS
RBITS
SBITS
SUITS
VALUES

Public Instance Methods

backside_to_unicode() click to toggle source
# File lib/playing_cards/card.rb, line 23
def backside_to_unicode
  "\u{1F0A0}"
end
inspect()
Alias for: to_unicode
to_s() click to toggle source
# File lib/playing_cards/card.rb, line 14
def to_s
  "#{rank.to_s} of #{suit.to_sym}"
end
to_unicode() click to toggle source
# File lib/playing_cards/card.rb, line 18
def to_unicode
  ["1F0#{suit_bit}#{rank_bit}".hex].pack("U")
end
Also aliased as: inspect
value() click to toggle source
# File lib/playing_cards/card.rb, line 27
def value
  VALUES[RANKS.index(rank)].to_i
end

Private Instance Methods

rank_bit() click to toggle source
# File lib/playing_cards/card.rb, line 37
def rank_bit
  RBITS[RANKS.index(rank)]
end
suit_bit() click to toggle source
# File lib/playing_cards/card.rb, line 33
def suit_bit
  SBITS[SUITS.index(suit)]
end