class Kaze::Klass

Overview

Runtime representation of a class.

Defined in:

klass.cr

Constructors

Instance Method Summary

Instance methods inherited from class Kaze::Callable

arity : Int32 arity, call(interpreter : Interpreter, arguments : Array(VG)) : VG call, to_s : String to_s

Constructor Detail

def self.new(name : String, superclass : Klass | Nil, methods : Hash(String, Function)) #

[View source]

Instance Method Detail

def arity : Int32 #

Arity of a class is zero if it has no init method, else the arity equals that of the initializer.


[View source]
def call(interpreter : Interpreter, arguments : Array(VG)) : VG #

[View source]
def find_method(name : String) : Function | Nil #

[View source]
def name : String #

[View source]
def name=(name : String) #

[View source]
def superclass : Klass | Nil #

[View source]
def superclass=(superclass : Klass | Nil) #

[View source]
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.


[View source]