def to_s
      # A simple template with X's as placeholders
      # YY represents the placement of the card's rank
      template = <<-TPL.gsub(/^\s+/,'')
        ╭───────╮
        | X X X |
        | X X X |
        | X YYX |
        | X X X |
        ╰───────╯
      TPL

      # the patterns represent the configuration of glyphys
      #   read from left to right, top to bottom
      # X means place a glyph, _ means clear the space
      case @rank
        when 2;  pattern = '_X_______X_'
        when 3;  pattern = '_X__X____X_'
        when 4;  pattern = 'X_X_____X_X'
        when 5;  pattern = 'X_X_X___X_X'
        when 6;  pattern = 'X_XX_X__X_X'
        when 7;  pattern = 'X_X_X_XXX_X'
        when 8;  pattern = 'X_XX_XXXX_X'
        when 9;  pattern = 'X_XXXXXXX_X'
        when 10; pattern = 'XXXX_XXXXXX'
        when 11..14;
          pattern = 'X_________X'
      end

      pattern.each_char do |c|
        # replace X's with glyphs
        if c == 'X'
          template.sub!(/X/, "#{suit(true)}")
        # replace _'s with whitespace
        else
          template.sub!(/X/, " ")
        end
      end

      # place the card rank (left-padded)
      template.sub(/YY/, rank(true).ljust(2))
    end
def to_s
      # A simple template with X's as placeholders
      # YY represents the placement of the card's rank
      template = <<-TPL.gsub(/^\s+/,'')
        ╭───────╮
        | X X X |
        | X X X |
        | X YYX |
        | X X X |
        ╰───────╯
      TPL

      # the patterns represent the configuration of glyphys
      #   read from left to right, top to bottom
      # X means place a glyph, _ means clear the space
      case @rank
        when 2;  pattern = '_X_______X_'
        when 3;  pattern = '_X__X____X_'
        when 4;  pattern = 'X_X_____X_X'
        when 5;  pattern = 'X_X_X___X_X'
        when 6;  pattern = 'X_XX_X__X_X'
        when 7;  pattern = 'X_X_X_XXX_X'
        when 8;  pattern = 'X_XX_XXXX_X'
        when 9;  pattern = 'X_XXXXXXX_X'
        when 10; pattern = 'XXXX_XXXXXX'
        when 11..14;
          pattern = 'X_________X'
      end

      pattern.each_char do |c|
        # replace X's with glyphs
        if c == 'X'
          template.sub!(/X/, "#{suit(true)}")
        # replace _'s with whitespace
        else
          template.sub!(/X/, " ")
        end
      end

      # place the card rank (left-padded)
      template.sub(/YY/, rank(true).ljust(2))
    end
Returns the ASCII-art representation of the card.

 @return [String] The card drawn in ASCII characters.