Issue #5552 has been reported by Tsuyoshi Sawada.
Feature #5552: Array#ljust, Array#rjust
Author: Tsuyoshi Sawada
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
I propose the following methods Array#ljust(length [, pad]),
Array#rjust(length [, pad]), whose behaviour is analogous to
String#ljust(length [, padstr]), String#rjust(length [, padstr]).
[:a, :b, :c].ljust(2) #=> [:a, :b, :c]
[:a, :b, :c].ljust(5) #=> [:a, :b, :c, nil, nil]
[:a, :b, :c].ljust(5, :x) #=> [:a, :b, :c, :x, :x]