Module: Gemmy::Patches::StringPatch::InstanceMethods::AlignCenter
- Defined in:
- lib/gemmy/patches/string_patch.rb
Instance Method Summary collapse
Instance Method Details
#align_center(n, sep = "\n", c = ' ') ⇒ Object
facets
236 237 238 239 240 241 242 |
# File 'lib/gemmy/patches/string_patch.rb', line 236 def align_center(n, sep="\n", c=' ') return center(n.to_i,c.to_s) if sep==nil q = split(sep.to_s).collect { |line| line.center(n.to_i,c.to_s) } q.join(sep.to_s) end |