class SyntaxTree::ClassDeclaration

Class represents defining a class using the class keyword.

class Container
end

Classes can have path names as their class name in case it’s being nested under a namespace, as in:

class Namespace::Container
end

Classes can also be defined as a top-level path, in the case that it’s already in a namespace but you want to define it at the top-level instead, as in:

module OtherNamespace
  class ::Namespace::Container
  end
end

All of these declarations can also have an optional superclass reference, as in:

class Child < Parent
end

That superclass can actually be any Ruby expression, it doesn’t necessarily need to be a constant, as in:

class Child < method
end