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 SPVM language
my $class = SPVM::ExchangeAPI::Class->__new(__module_name => 'Int', __api => $api);
my $value = $class->new(1);
Create a class object using the SPVM::ExchangeAPI method in the SPVM::ExchangeAPI class:
my $class = $api->class('Int');
$class->new(1);
Fields
__module_name
my $__module_name = $self->__module_name;
$self->__module_name($__module_name);
Gets and sets a basic type 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:
__module_name
: stringA basic type name
__api
: SPVM::ExchangeAPIA SPVM::ExchangeAPI object
Instance Methods
AUTOLOAD
$class->foo(@args);
Calls call_method method in the SPVM::ExchangeAPI class using the "__module_name" field and the method name given in the AUTOLOAD
method.
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License