Module: SyntaxTree::AssignFormatting

Defined in:
lib/syntax_tree/node.rb

Overview

Determins if the following value should be indented or not.

Class Method Summary collapse

Class Method Details

.skip_indent?(value) ⇒ Boolean

Returns:

  • (Boolean)


1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
# File 'lib/syntax_tree/node.rb', line 1397

def self.skip_indent?(value)
  case value
  when ArrayLiteral, HashLiteral, Heredoc, Lambda, QSymbols, QWords,
       Symbols, Words
    true
  when CallNode
    skip_indent?(value.receiver)
  when DynaSymbol
    value.quote.start_with?("%s")
  else
    false
  end
end