The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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 the "__name" field and the method name given in the AUTOLOAD method.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License