SPVM::Builder::Resource - Resource
The SPVM::Builder::Resource class has methods to manipulate a resource.
my $resource = SPVM::Builder::Resource->new( class_name => 'Resource::Zlib', mode => 'high_performance', argv => ['foo', 'bar'], );
my $class_name = $resource->class_name; $resource->class_name($class_name);
Gets and sets the class_name field.
class_name
This field is a class name of a resource.
my $mode = $resource->mode; $resource->mode($mode);
Gets and sets the mode field.
mode
This field is a mode of a config file of a resource.
my $argv = $resource->argv; $resource->argv($argv);
This field is an array reference that contains command line arguments @ARGV of a config file of a resource.
@ARGV
my $config = $resource->config; $resource->config($config);
Gets and sets the config field.
config
This field is a a SPVM::Builder::Config object for a resource.
my $resource = SPVM::Builder::Resource->new(%fields);
Creates a SPVM::Builder::Resource object with "Fields".
Default Field Values:
If a field is not defined, the field is set to the following default value.
"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.