class SyntaxTree::Command

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/syntax_tree/node.rbs

class SyntaxTree::Command < SyntaxTree::Node
  def accept: (Visitor visitor) -> untyped
  def child_nodes: () -> untyped
  def initialize: (message: SyntaxTree::Ident, arguments: SyntaxTree::Args, block: nil, location: SyntaxTree::Location) -> void
end


method argument
method.
that Command nodes only happen when there is no explicit receiver for this
Command represents a method call with arguments and no parentheses. Note

def ===(other)

def ===(other)
  other.is_a?(Command) && message === other.message &&
    arguments === other.arguments && block === other.block
end

def accept(visitor)

Experimental RBS support (using type sampling data from the type_fusion project).

def accept: (Visitor visitor) -> untyped

This signature was generated using 2 samples from 1 application.

def accept(visitor)
  visitor.visit_command(self)
end

def align(q, node, &block)

def align(q, node, &block)
  arguments = node.arguments
  if arguments.is_a?(Args)
    parts = arguments.parts
    if parts.size == 1
      part = parts.first
      case part
      when DefNode
        q.text(" ")
        yield
      when IfOp
        q.if_flat { q.text(" ") }
        yield
      when Command
        align(q, part, &block)
      else
        q.text(" ")
        q.nest(message.value.length + 1) { yield }
      end
    else
      q.text(" ")
      q.nest(message.value.length + 1) { yield }
    end
  else
    q.text(" ")
    q.nest(message.value.length + 1) { yield }
  end
end

def arity

def arity
  arguments.arity
end

def child_nodes

Experimental RBS support (using type sampling data from the type_fusion project).

def child_nodes: () -> untyped

This signature was generated using 4 samples from 1 application.

def child_nodes
  [message, arguments, block]
end

def copy(message: nil, arguments: nil, block: nil, location: nil)

def copy(message: nil, arguments: nil, block: nil, location: nil)
  node =
    Command.new(
      message: message || self.message,
      arguments: arguments || self.arguments,
      block: block || self.block,
      location: location || self.location
    )
  node.comments.concat(comments.map(&:copy))
  node
end

def deconstruct_keys(_keys)

def deconstruct_keys(_keys)
  {
    message: message,
    arguments: arguments,
    block: block,
    location: location,
    comments: comments
  }
end

def format(q)

def format(q)
  q.group do
    q.format(message)
    align(q, self) { q.format(arguments) }
  end
  q.format(block) if block
end

def initialize(message:, arguments:, block:, location:)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (message: SyntaxTree::Ident, arguments: SyntaxTree::Args, block: nil, location: SyntaxTree::Location) -> void

This signature was generated using 2 samples from 1 application.

def initialize(message:, arguments:, block:, location:)
  @message = message
  @arguments = arguments
  @block = block
  @location = location
  @comments = []
end