Class String
In: lib/indentation/string_mod.rb
Parent: Object

Methods

Public Instance methods

Split across newlines and return the fewest number of indentation characters found on each line

Return an indented copy of this string Arguments:

  • num - How many of the specified indentation to use.
          Default for spaces is 2. Default for other is 1.
          If set to a negative value, removes that many of the specified indentation character,
          tabs, or spaces from the beginning of the string
    
  • i_char - Character (or string) to use for indentation

Indents this string Arguments:

  • num - How many of the specified indentation to use.
          Default for spaces is 2. Default for other is 1.
          If set to a negative value, removes that many of the specified indentation character,
          tabs, or spaces from the beginning of the string
    
  • i_char - Character (or string) to use for indentation

Find the least indentation of all lines within this string and remove that amount (if any) Can pass an optional modifier that changes the indentation amount removed

Replaces the current string with one that has had its indentation reset Can pass an optional modifier that changes the indentation amount removed

[Validate]