class SyntaxTree::ArrayLiteral::QSymbolsFormatter

Formats an array of multiple simple symbol literals into the %i syntax.

Attributes

contents[R]
Args

the contents of the array

Public Class Methods

new(contents) click to toggle source
# File lib/syntax_tree/node.rb, line 1098
def initialize(contents)
  @contents = contents
end

Public Instance Methods

format(q) click to toggle source
# File lib/syntax_tree/node.rb, line 1102
def format(q)
  q.text("%i[")
  q.group do
    q.indent do
      q.breakable_empty
      q.seplist(contents.parts, BREAKABLE_SPACE_SEPARATOR) do |part|
        q.format(part.value)
      end
    end
    q.breakable_empty
  end
  q.text("]")
end