Module: Jade::Formatter::MemberAccess

Extended by:
Helper, MemberAccess
Included in:
MemberAccess
Defined in:
lib/jade/formatter/accesses.rb

Overview

The three ‘target.member`-style accesses. Each has a slightly different `.name` shape (member is an Identifier, qualified is a raw string), but the formatting is `<target>.<rendered name>`.

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



11
12
13
14
# File 'lib/jade/formatter/accesses.rb', line 11

def format(node, indent:, source:)
  "#{format_node(node.target, source:)}.#{node.name.name}"
    .then(&and_indent(indent))
end