Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/birst_command/core_additions.rb
Instance Method Summary collapse
-
#unindent ⇒ Object
Strip leading whitespace from each line that is the same as the amount of whitespace on the first line of the string.
Instance Method Details
#unindent ⇒ Object
Strip leading whitespace from each line that is the same as the amount of whitespace on the first line of the string. Leaves additional indentation on later lines intact.
5 6 7 |
# File 'lib/birst_command/core_additions.rb', line 5 def unindent gsub /^#{self[/\A\s*/]}/, '' end |