class Cosmo::Class
- Cosmo::Class
- Reference
- Object
Defined in:
cosmo/runtime/types/class.crConstructors
Instance Method Summary
-
#construct(args : Array(ValueType)) : ClassInstance
Executes the class body, creates a
ClassInstance
, and callssetup
on it - #definition : Statement::ClassDef
- #interpreter : Interpreter
- #name
- #name_token
- #superclass : Class | Nil
-
#to_s : String
Returns a nicely readable and concise string representation of this object, typically intended for users.
Constructor Detail
def self.new(interpreter : Cosmo::Interpreter, closure : Cosmo::Scope, definition : Cosmo::AST::Statement::ClassDef, superclass : Nil | Cosmo::Class)
#
Instance Method Detail
Executes the class body, creates a ClassInstance
, and calls setup
on it
def to_s : String
#
Description copied from class Object
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO)
which can be overridden for custom implementations.
Also see #inspect
.