Name

SPVM::ExchangeAPI::Class - Class Object

Description

SPVM::BlessedObject::Class is a class object to call class methods.

Usage

# The same as the Int->__new(1) in the SPVM language
my $class = SPVM::ExchangeAPI::Class->__new(__name => 'Int', __api => $api);
my $value = $class->new(1);

It is easy to use SPVM::ExchangeAPI#class.

my $class = $api->class('Int');
$class->new(1);

Fields

__name

my $name = $self->__name;
$self->__name($name);

Gets and sets a class name.

__api

my $api = $self->__api;
$self->__api($api);

Gets and sets a SPVM::ExchangeAPI object.

Class Methods

__new

my $class = SPVM::ExchangeAPI::Class->__new(%options);

Creates a new SPVM::ExchangeAPI::Class object.

Options:

Instance Methods

AUTOLOAD

$class->foo(@args);

Calls SPVM::ExchangeAPI#call_method using "__name" field and the method name given in AUTOLOAD method.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License