Module: Jade::Formatter::Assign

Extended by:
Assign, Helper
Included in:
Assign
Defined in:
lib/jade/formatter/bindings.rb

Overview

‘name = expr` and `name <- task` — same shape, different operator.

Instance Method Summary collapse

Methods included from Helper

and_indent, dispatch_for, format_delimited, format_exposing, format_leading_comments, format_node, format_pattern, format_trailing_comment, format_type, format_type_atom, too_long?

Instance Method Details

#format(node, indent:, source:) ⇒ Object



9
10
11
12
13
14
# File 'lib/jade/formatter/bindings.rb', line 9

def format(node, indent:, source:)
  node => AST::Assign(pattern:, expression:)

  "#{format_pattern(pattern)} = #{format_node(expression, source:)}"
    .then(&and_indent(indent))
end