Sha256: 06a10214918993a6880f6b3e8ca7e36c9ecc7956053fd1404149136a0cf2417a
Contents?: true
Size: 437 Bytes
Versions: 64
Compression:
Stored size: 437 Bytes
Contents
# encoding: utf-8 # String class String # get spacing string # # === Example # # input # hoge = 'hoge' # hoge.spacing # => 'h o g e' # hoge.spacing({char: '_', size: 2}) # => 'h__o__g__e' # def spacing(options = { char: ' ', size: 1 }) options[:char] = ' ' unless options[:char] options[:size] = 1 unless options[:size] chars.to_a.join(options[:char] * options[:size]) end end
Version data entries
64 entries across 64 versions & 1 rubygems