Skip to content

class Crystal::ClassDef
inherits Crystal::ASTNode

Class definition:

'class' name [ '<' superclass ]
  body
'end'

Included modules

Crystal::HookExpansionsContainer

Class methods

.new(name, body = nil, superclass = nil, type_vars = nil, abstract __arg39 = false, struct __arg40 = false, splat_index = nil)

View source

Methods

#==(other : self)

Returns true if this reference is the same as other. Invokes same?.

#abstract=(abstract __arg0 : Bool)

View source

#abstract? : Bool

View source

#accept_children(visitor)

View source

#body=(body : ASTNode)

View source

#clone_without_location

View source

#doc : String?

Returns the doc comment attached to this node. Not every node supports having doc comments, so by default this returns nil.

View source

#doc=(doc : String?)

View source

#hash(hasher)

#name : Path

View source

#name=(name : Path)

View source

#name_location : Location?

View source

#name_location=(name_location : Location?)

View source

#resolved_type : ClassType

#resolved_type=(resolved_type : ClassType)

View source

#resolved_type? : ClassType?

#splat_index : Int32?

View source

#splat_index=(splat_index : Int32?)

View source

#struct=(struct __arg0 : Bool)

View source

#struct? : Bool

View source

#superclass : ASTNode?

View source

#superclass=(superclass : ASTNode?)

View source

#type_vars : Array(String)?

View source

#type_vars=(type_vars : Array(String)?)

View source

#visibility=(visibility)

View source