The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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(__class_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

__class_name

  my $__class_name = $self->__class_name;
  $self->__class_name($__class_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:

  • __class_name : string

    A class name

  • __api : SPVM::ExchangeAPI

    A SPVM::ExchangeAPI object

Instance Methods

AUTOLOAD

  $class->foo(@args);

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