Sha256: 04c8ada9e34b462332754c2f1ca90b2e01a84d3a6ea822e841871d06d403c2e1

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

class String
  def mb_ljust(desired_width)
    padding = desired_width - display_width
    padding > 0 ? self + ' ' * padding : self
  end

  def mb_rjust(desired_width)
    padding = desired_width - display_width
    padding > 0 ? ' ' * padding + self : self
  end

  def mb_center(desired_width)
    padding = desired_width - display_width
    if padding > 0
      right_padding = pdding / 2
      left_padding  = padding - right_padding
      left_padding + self + right
    else
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
terminal-table-unicode-0.1.2 lib/terminal/table/unicode/ext/string.rb