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
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 |