instance method with_indentation

Ruby on Rails 8.0.4

Since v6.0.6 Private

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

with_indentation(&block)

Increases the current indentation indentation level for the duration of the given block, and decreases it after the block ends. Call #indentation to get an indentation string.

Parameters

block block
Source
# File railties/lib/rails/generators/actions.rb, line 503
        def with_indentation(&block) # :doc:
          @indentation += 1
          instance_eval(&block)
        ensure
          @indentation -= 1
        end

Defined in railties/lib/rails/generators/actions.rb line 503 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Generators::Actions

Type at least 2 characters to search.

↑↓ navigate · open · esc close