Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/birst_command/core_additions.rb

Instance Method Summary collapse

Instance Method Details

#unindentObject

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