From: Yukihiro Matsumoto Date: 2011-11-03T19:36:58+09:00 Subject: [ruby-dev:44790] [ruby-trunk - Feature #5552][Feedback] Array#ljust, Array#rjust Issue #5552 has been updated by Yukihiro Matsumoto. Status changed from Open to Feedback なぜそれが必要なのか提案に含めてください。Stringにあるから、では不十分です。 私にはArray#ljustなどがあって嬉しい局面が想像できません。 ---------------------------------------- Feature #5552: Array#ljust, Array#rjust http://redmine.ruby-lang.org/issues/5552 Author: Tsuyoshi Sawada Status: Feedback 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] -- http://redmine.ruby-lang.org