Method: HighLine#indent

Defined in:
lib/highline.rb

#indent(increase = 1, statement = nil, multiline = nil) ⇒ void

This method returns an undefined value.

Executes block or outputs statement with indentation

Parameters:

  • increase (Integer) (defaults to: 1)

    how much to increase indentation

  • statement (Statement, String) (defaults to: nil)

    to be said

  • multiline (Boolean) (defaults to: nil)

See Also:



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/highline.rb', line 448

def indent(increase = 1, statement = nil, multiline = nil)
  @indent_level += increase
  multi = @multi_indent
  @multi_indent ||= multiline
  begin
    if block_given?
      yield self
    else
      say(statement)
    end
  ensure
    @multi_indent = multi
    @indent_level -= increase
  end
end