Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/manipulation/api.rb

Overview

Core extensions

Instance Method Summary collapse

Instance Method Details

#indent(char, count) ⇒ Object

Returns an indented string, all lines of string will be indented with count of chars



27
28
29
# File 'lib/manipulation/api.rb', line 27

def indent(char, count)
  (char * count) + gsub(/(\n+)/) { $1 + (char * count) }
end