SPVM::Builder::Resource - Resource
The SPVM::Builder::Resource class has methods to manipulate resources.
my $resource = SPVM::Builder::Resource->new( class_name => 'Resource::Zlib', mode => 'high_performance', argv => ['foo', 'bar'], );
See SPVM::Document::Resource about creating and using resources.
my $class_name = $resource->class_name; $resource->class_name($class_name);
Gets and sets the class_name field, the class name of this resource.
class_name
my $mode = $resource->mode; $resource->mode($mode);
Gets and sets the mode field, the mode of the config file of this resource.
mode
my $argv = $resource->argv; $resource->argv($argv);
Gets and sets the argv field, an array reference of command line arguments @ARGV given to the config file of this resource.
argv
@ARGV
my $config = $resource->config; $resource->config($config);
Gets and sets the config field, a SPVM::Builder::Config object.
config
my $resource = SPVM::Builder::Resource->new(%fields);
Creates a new SPVM::Builder::Resource object with "Fields".
Field Default Values:
"class_name"
undef
"mode"
"argv"
[]
"config"
my $string = $resource->to_string;
Returns the "class_name" field.
Overloads the following operators.
my $bool = !!$resource;
Always true.
my $class_name = "$resource";
The alias for the "to_string" method.
Copyright (c) 2023 Yuki Kimoto
MIT License
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.