NAME

Data::Object::Utility

ABSTRACT

Data-Object Utility Functions

SYNOPSIS

use Data::Object::Utility;

my $array = Data::Object::Utility::Deduce []; # Data::Object::Array
my $value = Data::Object::Utility::Detract $array; # [,...]

DESCRIPTION

This package provides a suite of utility functions designed to be used internally across core packages.

FUNCTIONS

This package implements the following functions.

deduce

Deduce(Any $arg1) : Any

The Deduce function returns a data type object instance based upon the deduced type of data provided.

Deduce example
# given ...

Data::Object::Utility::Deduce(...);

deduceblessed

DeduceBlessed(Any $arg1) : Int

The DeduceBlessed function returns truthy if the argument is blessed.

DeduceBlessed example
# given ...

Data::Object::Utility::DeduceBlessed(...);

deducedeep

DeduceDeep(Any $arg1) : Any

The DeduceDeep function returns a data type object. If the data provided is complex, this function traverses the data converting all nested data to objects. Note: Blessed objects are not traversed.

DeduceDeep example
# given ...

Data::Object::Utility::DeduceDeep(...);

deducedefined

DeduceDefined(Any $arg1) : Int

The DeduceDefined function returns truthy if the argument is defined.

DeduceDefined example
# given ...

Data::Object::Utility::DeduceDefined(...);

deducenumberlike

DeduceNumberlike(Any $arg1) : Int

The DeduceNumberlike function returns truthy if the argument is numberlike.

DeduceNumberlike example
# given ...

Data::Object::Utility::DeduceNumberlike(...);

deducereferences

DeduceReferences(Any $arg1) : Int

The DeduceReferences function returns a data object based on the type of argument reference provided.

DeduceReferences example
# given ...

Data::Object::Utility::DeduceReferences(...);

deducestringlike

DeduceStringLike(Any $arg1) : Int

The DeduceStringLike function returns truthy if the argument is stringlike.

DeduceStringLike example
# given ...

Data::Object::Utility::DeduceStringLike(...);

detract

Detract(Any $arg1) : Any

The Detract function returns a value of native type, based upon the underlying reference of the data type object provided.

Detract example
# given ...

Data::Object::Utility::Detract(...);

detractdeep

DetractDeep(Any $arg1) : Any

The DetractDeep function returns a value of native type. If the data provided is complex, this function traverses the data converting all nested data type objects into native values using the objects underlying reference. Note: Blessed objects are not traversed.

DetractDeep example
# given ...

Data::Object::Utility::DetractDeep(...);

typeany

TypeAny(Any $arg1) : Object

The TypeAny function returns a Data::Object::Any instance which wraps the provided data type and can be used to perform operations on the data.

TypeAny example
# given ...

Data::Object::Utility::TypeAny(...);

typearray

TypeArray(ArrayRef $arg1) : ArrayObject

The TypeArray function returns a Data::Object::Array instance which wraps the provided data type and can be used to perform operations on the data.

TypeArray example
# given ...

Data::Object::Utility::TypeArray(...);

typecode

TypeCode(CodeRef $arg1) : CodeObject

The TypeCode function returns a Data::Object::Code instance which wraps the provided data type and can be used to perform operations on the data.

TypeCode example
# given ...

Data::Object::Utility::TypeCode(...);

typedata

TypeData(Str $arg1) : Object

The TypeData function returns a Data::Object::Data instance which parses pod-ish data in files and packages.

TypeData example
# given ...

Data::Object::Utility::TypeData(...);

typedispatch

TypeDispatch(Str $arg1) : Object

The TypeDispatch function return a Data::Object::Dispatch object which is a handle that let's you call into other packages.

TypeDispatch example
# given ...

Data::Object::Utility::TypeDispatch(...);

typeexception

TypeException(Any @args) : Object

The TypeException function returns a Data::Object::Exception instance which can be thrown.

TypeException example
# given ...

Data::Object::Utility::TypeException(...);

typefloat

TypeFloat(Str $arg1) : FloatObject

The TypeFloat function returns a Data::Object::Float instance which wraps the provided data type and can be used to perform operations on the data.

TypeFloat example
# given ...

Data::Object::Utility::TypeFloat(...);

typehash

TypeHash(HashRef $arg1) : HashObject

The TypeHash function returns a Data::Object::Hash instance which wraps the provided data type and can be used to perform operations on the data.

TypeHash example
# given ...

Data::Object::Utility::TypeHash(...);

typeinteger

TypeInteger(Int $arg1) : IntObject

The TypeInteger function returns a Data::Object::Object instance which wraps the provided data type and can be used to perform operations on the data.

TypeInteger example
# given ...

Data::Object::Utility::TypeInteger(...);

typename

TypeName(Any $arg1) : Str

The TypeName function returns a data type description for the type of data provided, represented as a string in capital letters.

TypeName example
# given ...

Data::Object::Utility::TypeName(...);

typenumber

TypeNumber(Num $arg1) : NumObject

The TypeNumber function returns a Data::Object::Number instance which wraps the provided data type and can be used to perform operations on the data.

TypeNumber example
# given ...

Data::Object::Utility::TypeNumber(...);

typeregexp

TypeRegexp(RegexpRef $arg1) : RegexpObject

The TypeRegexp function returns a Data::Object::Regexp instance which wraps the provided data type and can be used to perform operations on the data.

TypeRegexp example
# given ...

Data::Object::Utility::TypeRegexp(...);

typescalar

TypeScalar(Any $arg1) : ScalarObject

The TypeScalar function returns a Data::Object::Scalar instance which wraps the provided data type and can be used to perform operations on the data.

TypeScalar example
# given ...

Data::Object::Utility::TypeScalar(...);

typespace

TypeSpace(Str $arg1) : Object

The TypeSpace function returns a Data::Object::Space instance which provides methods for operating on package and namespaces.

TypeSpace example
# given ...

Data::Object::Utility::TypeSpace(...);

typestring

TypeString(Str $arg1) : StrObject

The TypeString function returns a Data::Object::String instance which wraps the provided data type and can be used to perform operations on the data.

TypeString example
# given ...

Data::Object::Utility::TypeString(...);

typeundef

TypeUndef(Undef $arg1) : UndefObject

The TypeUndef function returns a Data::Object::Undef instance which wraps the provided data type and can be used to perform operations on the data.

TypeUndef example
# given ...

Data::Object::Utility::TypeUndef(...);

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.

PROJECT

On GitHub

Initiatives

Contributing

Reporting

SEE ALSO

To get the most out of this distribution, consider reading the following:

Data::Object::Class

Data::Object::Role

Data::Object::Rule

Data::Object::Library

Data::Object::Signatures