NAME
Data::Object::Config
ABSTRACT
Data-Object Package Configuration
SYNOPSIS
use Data::Object::Config 'Core';
DESCRIPTION
This package is used to configure the consuming package based on arguments passed to the import statement.
CONFIGURATIONS
This package is used by both Do and Data::Object to configure the calling namespace.
core
package main;
use Data::Object::Config 'Core';
fun main() {
# ...
}
1;
The core configuration enables strict, warnings, Perl's 5.14 features, and configures the core type library, method signatures, and autoboxing.
library
package App::Library;
use Data::Object::Config 'Library';
our $User = declare 'User',
as InstanceOf["App::User"];
1;
The library configuration established a Type::Library compliant type library, as well as configuring Type::Utils in the calling package. Read more at Data::Object::Library.
class
package App::User;
use Data::Object::Config 'Class';
has 'fname';
has 'lname';
1;
The class configuration configures the calling package as a Moo class, having the "has", "with", and "extends" keywords available. Read more at Data::Object::Class.
role
package App::Queuer;
use Data::Object::Config 'Role';
has 'queue';
method dequeue() {
# ...
}
method enqueue($job) {
# ...
}
1;
The role configuration configures the calling package as a Moo role, having the "has", "with", and "extends" keywords available. Read more at Data::Object::Role.
rule
package App::Queueable;
use Data::Object::Config 'Rule';
requires 'dequeue';
requires 'enqueue';
1;
The rule configuration configures the calling package as a Moo role, intended to be used to classify interfaces. Read more at Data::Object::Rule.
state
package App::Env;
use Data::Object::Config 'State';
has 'vars';
has 'args';
has 'opts';
1;
The state configuration configures the calling package as a singleton class with global state. Read more at Data::Object::State.
struct
package App::Data;
use Data::Object::Config 'Struct';
has 'auth';
has 'user';
has 'args';
1;
The struct configuration configures the calling package as a class whose state becomes immutable after instantiation. Read more at Data::Object::Struct.
array
package App::Args;
use Data::Object::Config 'Array';
method command() {
return $self->get(0);
}
1;
The array configuration configures the calling package as a class which extends the Array class. Read more at Data::Object::Array.
code
package App::Func;
use Data::Object::Config 'Code';
around BUILD($args) {
$self->$orig($args);
# ...
}
1;
The code configuration configures the calling package as a class which extends the Code class. Read more at Data::Object::Code.
float
package App::Amount;
use Data::Object::Config 'Float';
method currency(Str $code) {
# ...
}
1;
The float configuration configures the calling package as a class which extends the Float class. Read more at Data::Object::Float.
hash
package App::Data;
use Data::Object::Config 'Hash';
method logline() {
# ...
}
1;
The hash configuration configures the calling package as a class which extends the Hash class. Read more at Data::Object::Hash.
integer
package App::Phone;
use Data::Object::Config 'Integer';
method format(Str $code) {
# ...
}
1;
The integer configuration configures the calling package as a class which extends the Integer class. Read more at Data::Object::Integer.
number
package App::ID;
use Data::Object::Config 'Number';
method find() {
# ...
}
1;
The number configuration configures the calling package as a class which extends the Number class. Read more at Data::Object::Number.
regexp
package App::Path;
use Data::Object::Config 'Regexp';
method match() {
# ...
}
1;
The regexp configuration configures the calling package as a class which extends the Regexp class. Read more at Data::Object::Regexp.
scalar
package App::OID;
use Data::Object::Config 'Scalar';
method find() {
# ...
}
1;
The scalar configuration configures the calling package as a class which extends the Scalar class. Read more at Data::Object::Scalar.
string
package App::Title;
use Data::Object::Config 'String';
method generate() {
# ...
}
1;
The string configuration configures the calling package as a class which extends the String class. Read more at Data::Object::String.
undef
package App::Fail;
use Data::Object::Config 'Undef';
method explain() {
# ...
}
1;
The undef configuration configures the calling package as a class which extends the Undef class. Read more at Data::Object::Undef.
FUNCTIONS
This package implements the following functions.
choose
choose(Str $arg1) : ArrayRef
The choose function returns the configuration (plans) based on the argument passed.
config
config(ArrayRef $arg1) : ArrayRef
The config function returns plans for configuring a package with the standard Data::Object setup.
config_array
config_array() : ArrayRef
The config_array function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Array.
config_base
config_base() : ArrayRef
The config_base function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Base.
config_class
config_class() : ArrayRef
The config_class function returns plans for configuring the package to be a Data::Object::Class.
config_cli
config_cli() : ArrayRef
The config_cli function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Cli.
config_code
config_code() : ArrayRef
The config_code function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Code.
config_dispatch
config_dispatch() : ArrayRef
The config_dispatch function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Dispatch.
config_exception
config_exception() : ArrayRef
The config_exception function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Exception.
config_float
config_float() : ArrayRef
The config_float function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Float.
config_hash
config_hash() : ArrayRef
The config_hash function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Hash.
config_integer
config_integer() : ArrayRef
The config_integer function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Integer.
config_library
config_library() : ArrayRef
The config_library function returns plans for configuring the package to be a Type::Library which extends Data::Object::Library with Type::Utils configured.
config_number
config_number() : ArrayRef
The config_number function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Number.
config_regexp
config_regexp() : ArrayRef
The config_regexp function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Regexp.
config_replace
config_replace() : ArrayRef
The config_replace function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Replace.
config_role
config_role() : ArrayRef
The config_role function returns plans for configuring the package to be a Data::Object::Role.
config_rule
config_rule() : ArrayRef
The config_rule function returns plans for configuring a package to be a Data::Object::Rule.
config_scalar
config_scalar() : ArrayRef
The config_scalar function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Scalar.
config_search
config_search() : ArrayRef
The config_search function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Search.
config_state
config_state() : ArrayRef
The config_state function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::State.
config_string
config_string() : ArrayRef
The config_string function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::String.
config_type
config_type() : ArrayRef
The config_type function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Type.
config_undef
config_undef() : ArrayRef
The config_undef function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Undef.
prepare
prepare(Str $arg1, Str $arg2) : ArrayRef
The prepare function returns configuration plans based on the arguments passed.
prepare_add
prepare_add(Str $arg1, Str $arg2) : ArrayRef
The prepare_add function returns an add-plan for the arguments passed.
prepare_call
prepare_call(Str $arg1, Any @args) : ArrayRef
The prepare_call function returns a call-plan for the arguments passed.
prepare_let
prepare_let(Str $arg1, Any @args) : ArrayRef
The prepare_let function returns a let-plan for the arguments passed.
prepare_use
prepare_use(Str $arg1, Any @args) : ArrayRef
The prepare_use function returns a use-plan for the arguments passed.
process
process(Str $arg1, ArrayRef $arg2) : Any
The process function executes a series of plans on behalf of the caller.
process_add
process_add(Str $arg1, ArrayRef $arg2) : Any
The process_add function executes the add-plan on behalf of the caller.
process_call
process_call(Str $arg1, ArrayRef $arg2) : Any
The process_call function executes the call-plan on behalf of the caller.
process_let
process_let(Str $arg1, ArrayRef $arg2) : Any
The process_let function executes the let-plan on behalf of the caller.
process_use
process_use(Str $arg1, ArrayRef $arg2) : Any
The process_use function executes the use-plan on behalf of the caller.
subject
subject(Str $arg1, Str $arg2) : Int
The subject function returns truthy if both arguments match alphanumerically (not case-sensitive).
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
STATUS
SEE ALSO
To get the most out of this distribution, consider reading the following: