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.
args
package App::Args;
use Data::Object::Config 'Args';
method validate() {
# ...
}
1;
The args configuration configures the calling package as a class representation of the @ARGV
variable. Read more at Data::Object::Args.
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.
cli
package App::Cli;
use Data::Object::Config 'Cli';
method main(%args) {
# ...
}
1;
The cli configuration configures the calling package as a class capable of acting as a command-line interface. Read more at Data::Object::Cli.
data
package App::Data;
use Data::Object::Config 'Data';
method generate() {
# ...
}
1;
The data configuration configures the calling package as a class capable of parsing POD. Read more at Data::Object::Data.
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.
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.
opts
package App::Opts;
use Data::Object::Config 'Opts';
method validate() {
# ...
}
1;
The opts configuration configures the calling package as a class representation of the command-line arguments. Read more at Data::Object::Opts.
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.
vars
package App::Vars;
use Data::Object::Config 'Vars';
method config() {
# ...
}
1;
The vars configuration configures the calling package as a class representation of the %ENV
variable. Read more at Data::Object::Vars.
with
package App::Error;
use Data::Object::Config 'Class';
use Data::Object::Config 'WithStashable';
# e.g.
# use Data::Object::Config 'WithDumpable';
# use Data::Object::Config 'WithImmutable
# use Data::Object::Config 'WithProxyable
# use Data::Object::Config 'WithStashable
# use Data::Object::Config 'WithThrowable
# use Data::Object::Config 'WithTryable
1;
The with configuration configures the calling package to consume the core role denoted in the name, e.g. the name WithStashable
configures the package to consume the core role Data::Object::Role::Stashable. Using roles requires that the package have previously been declared a class or role itself. This pattern for including core roles works with any core role and can be used by simplyt prefixing the role name with the term With
(with no spaces).
LIBRARIES
This package uses type constraints defined by:
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_args
config_args() : ArrayRef
The config_args function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Args.
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_core
config_core() : ArrayRef
The config_core function returns plans for configuring the package to have the Data::Object framework default configuration.
config_data
config_data() : ArrayRef
The config_data function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Data.
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_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_opts
config_opts() : ArrayRef
The config_opts function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Opts.
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_space
config_space() : ArrayRef
The config_space function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Space.
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_struct
config_struct() : ArrayRef
The config_struct function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Struct.
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.
config_vars
config_vars() : ArrayRef
The config_vars function returns plans for configuring the package to be a Data::Object::Class which extends Data::Object::Vars.
config_withdumpable
config_withdumpable() : ArrayRef
The config_withdumpable function returns plans for configuring the package to consume the Data::Object::Role::Dumbable role.
config_withimmutable
config_withimmutable() : ArrayRef
The config_withimmutable function returns plans for configuring the package to consume the Data::Object::Role::Immutable role.
config_withproxyable
config_withproxyable() : ArrayRef
The config_withproxyable function returns plans for configuring the package to consume the Data::Object::Role::Proxyable role.
config_withstashable
config_withstashable() : ArrayRef
The config_withstashable function returns plans for configuring the package to consume the Data::Object::Role::Stashable role.
config_withthrowable
config_withthrowable() : ArrayRef
The config_withthrowable function returns plans for configuring the package to consume the Data::Object::Role::Throwable role.
config_withtryable
config_withtryable() : ArrayRef
The config_withtryable function returns plans for configuring the package to consume the Data::Object::Role::Tryable role.
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).
CREDITS
Al Newkirk, +319
Anthony Brummett, +10
Adam Hopkins, +2
José Joaquín Atria, +1
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 terms of the The Apache License, Version 2.0, as elucidated here, https://github.com/iamalnewkirk/do/blob/master/LICENSE.
PROJECT
SEE ALSO
To get the most out of this distribution, consider reading the following: