Method: String#pop_lines
- Defined in:
- lib/hash-utils/string.rb
#pop_lines(count = 1) ⇒ Object
613 614 615 616 617 618 |
# File 'lib/hash-utils/string.rb', line 613 def pop_lines(count = 1) lines = self.last_lines(count) length = lines.inject(0) { |sum, i| sum + i.length } self.replace(self[0..(length - 1)]) return lines end |