Module: Gemmy::Patches::StringPatch::InstanceMethods::AlignLeft
- Defined in:
- lib/gemmy/patches/string_patch.rb
Instance Method Summary collapse
Instance Method Details
#align_left(n, sep = "\n", c = ' ') ⇒ Object
facets
241 242 243 244 245 246 247 |
# File 'lib/gemmy/patches/string_patch.rb', line 241 def align_left(n, sep="\n", c=' ') return ljust(n.to_i,c.to_s) if sep==nil q = split(sep.to_s).map do |line| line.strip.ljust(n.to_i,c.to_s) end q.join(sep.to_s) end |