Name
SPVM::Builder::Resource - Resource
Description
The SPVM::Builder::Resource class has methods to manipulate resources.
Usage
my $resource = SPVM::Builder::Resource->new(
class_name => 'Resource::Zlib',
);
Details
See SPVM::Document::Resource about creating and using resources.
Fields
class_name
my $class_name = $resource->class_name;
$resource->class_name($class_name);
Gets and sets the class_name
field, the class name of this resource.
config
my $config = $resource->config;
$resource->config($config);
Gets and sets the config
field, an SPVM::Builder::Config object.
Class Methods
new
my $resource = SPVM::Builder::Resource->new(%fields);
Creates a new SPVM::Builder::Resource object with "Fields".
Field Default Values:
-
undef
-
undef
Instance Methods
to_string
my $string = $resource->to_string;
Returns "class_name" field.
Operators
Overloads the following operators.
bool
my $bool = !!$resource;
Always true.
stringify
my $class_name = "$resource";
The alias for "to_string" method.
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License