instance method
with_indentation
Ruby on Rails 7.2.3
Since v6.0.6 PrivateSignature
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
-
blockblock
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