class SyntaxTree::ModuleDeclaration

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

# sig/syntax_tree/node.rbs

class SyntaxTree::ModuleDeclaration < SyntaxTree::Node
  def child_nodes: () -> untyped
  def initialize: (constant: SyntaxTree::ConstRef, bodystmt: SyntaxTree::BodyStmt, location: SyntaxTree::Location) -> void
end


end
module Namespace
ModuleDeclaration represents defining a module using the module keyword.

def ===(other)

def ===(other)
  other.is_a?(ModuleDeclaration) && constant === other.constant &&
    bodystmt === other.bodystmt
end

def accept(visitor)

def accept(visitor)
  visitor.visit_module(self)
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 5 samples from 1 application.

def child_nodes
  [constant, bodystmt]
end

def copy(constant: nil, bodystmt: nil, location: nil)

def copy(constant: nil, bodystmt: nil, location: nil)
  node =
    ModuleDeclaration.new(
      constant: constant || self.constant,
      bodystmt: bodystmt || self.bodystmt,
      location: location || self.location
    )
  node.comments.concat(comments.map(&:copy))
  node
end

def deconstruct_keys(_keys)

def deconstruct_keys(_keys)
  {
    constant: constant,
    bodystmt: bodystmt,
    location: location,
    comments: comments
  }
end

def format(q)

def format(q)
  if bodystmt.empty?
    q.group do
      format_declaration(q)
      q.breakable_force
      q.text("end")
    end
  else
    q.group do
      format_declaration(q)
      q.indent do
        q.breakable_force
        q.format(bodystmt)
      end
      q.breakable_force
      q.text("end")
    end
  end
end

def format_declaration(q)

def format_declaration(q)
  q.group do
    q.text("module ")
    q.format(constant)
  end
end

def initialize(constant:, bodystmt:, location:)

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

def initialize: (constant: SyntaxTree::ConstRef, bodystmt: SyntaxTree::BodyStmt, location: SyntaxTree::Location) -> void

This signature was generated using 1 sample from 1 application.

def initialize(constant:, bodystmt:, location:)
  @constant = constant
  @bodystmt = bodystmt
  @location = location
  @comments = []
end