GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DATA::OBJECT::SYNTAX (3)

.ds Aq ’

NAME

Data::Object::Syntax - Object Syntax DSL for Perl 5

CONTENTS

VERSION

version 0.59

SYNOPSIS



    use Data::Object::Syntax;



DESCRIPTION

Data::Object::Class::Syntax exports a collection of functions that provide a DSL (syntactic sugar) for declaring and describing Data::Object::Class classes. This package is used as a template for Data::Object::Class::Syntax and Data::Object::Role::Syntax. It is highly recommended that you also use the namespace::autoclean library to automatically cleanup the functions exported by this library and avoid method name collisions.

FUNCTIONS

    alt



    alt attr => (is => ro);

    # equivalent to

    has +attr => (..., is => ro);



The alt function alters the preexisting attribute definition for the attribute specified.

    builder



    builder;
    builder _build_attr;

    # equivalent to

    has attr => ..., builder => _build_attr;



The builder function returns a list suitable for configuring the builder portion of the attribute declaration.

    clearer



    clearer;
    clearer _clear_attr;

    # equivalent to

    has attr => ..., clearer => _clean_attr;



The clearer function returns a list suitable for configuring the clearer portion of the attribute declaration.

    coerce



    coerce;

    # equivalent to

    has attr => ..., coerce => 1;



The coerce function return a list suitable for configuring the coerce portion of the attribute declaration.

    def



    def attr => sub { 1 };

    # equivalent to

    has +attr => (..., default => sub { 1 });



The def function alters the preexisting attribute definition setting and/or overriding the default value property.

    default



    default sub { ... };

    # equivalent to

    has attr => ..., default => sub { ... };



The default function returns a list suitable for configuring the default portion of the attribute declaration.

    defaulter



    defaulter;
    defaulter _default_attr;

    # equivalent to

    has attr => ..., default => sub { $class->_default_attr(...) };



The defaulter function returns a list suitable for configuring the default portion of the attribute declaration. The argument must be the name of an existing routine available to the class.

    handles



    handles { ... };

    # equivalent to

    has attr => ..., handles => { ... };



The handles function returns a list suitable for configuring the handles portion of the attribute declaration.

    init_arg



    init_arg;
    init_arg altattr;

    # equivalent to

    has attr => ..., init_arg => altattr;



The init_arg function returns a list suitable for configuring the init_arg portion of the attribute declaration.

    is



    is;



The is function returns a list from a list, and acts merely as a pass-through, for the purpose of being a visual/descriptive aid.

    isa



    isa sub { ... };

    # equivalent to

    has attr => ..., isa => sub { ... };



The isa function returns a list suitable for configuring the isa portion of the attribute declaration.

    lazy



    lazy;

    # equivalent to

    has attr => ..., lazy => 1;



The lazy function returns a list suitable for configuring the lazy portion of the attribute declaration.

    opt



    opt attr => sub { ... };

    # equivalent to

    has +attr => ..., required => 0, isa => sub { ... };



The opt function alters the preexisting attribute definition for the attribute specified using a list suitable for configuring the required and isa portions of the attribute declaration.

    optional



    optional;

    # equivalent to

    has attr => ..., required => 0;



The optional function returns a list suitable for configuring the required portion of the attribute declaration.

    predicate



    predicate;
    predicate _has_attr;

    # equivalent to

    has attr => ..., predicate => _has_attr;



The predicate function returns a list suitable for configuring the predicate portion of the attribute declaration.

    reader



    reader;
    reader _get_attr;

    # equivalent to

    has attr => ..., reader => _get_attr;



The reader function returns a list suitable for configuring the reader portion of the attribute declaration.

    req



    req attr => sub { ... };

    # equivalent to

    has +attr => ..., required => 1, isa => sub { ... };



The req function alters the preexisting attribute definition for the attribute specified using a list suitable for configuring the required and isa portions of the attribute declaration.

    required



    required;

    # equivalent to

    has attr => ..., required => 1;



The required function returns a list suitable for configuring the required portion of the attribute declaration.

    ro



    ro;

    # equivalent to

    has attr => ..., is => ro;



The ro function returns a list suitable for configuring the is portion of the attribute declaration.

    rw



    rw;

    # equivalent to

    has attr => ..., is => rw;



The rw function returns a list suitable for configuring the rw portion of the attribute declaration.

    trigger



    trigger;
    trigger _trigger_attr;

    # equivalent to

    has attr => ..., trigger => _trigger_attr;



The trigger function returns a list suitable for configuring the trigger portion of the attribute declaration.

    weak_ref



    weak_ref;

    # equivalent to

    has attr => ..., weak_ref => 1;



The weak_ref function returns a list suitable for configuring the weak_ref portion of the attribute declaration.

    writer



    writer;
    writer _set_attr;

    # equivalent to

    has attr => ..., writer => _set_attr;



The writer function returns a list suitable for configuring the writer portion of the attribute declaration.

SEE ALSO

o Data::Object::Array
o Data::Object::Class
o Data::Object::Class::Syntax
o Data::Object::Code
o Data::Object::Float
o Data::Object::Hash
o Data::Object::Integer
o Data::Object::Number
o Data::Object::Role
o Data::Object::Role::Syntax
o Data::Object::Regexp
o Data::Object::Scalar
o Data::Object::String
o Data::Object::Undef
o Data::Object::Universal
o Data::Object::Autobox
o Data::Object::Immutable
o Data::Object::Library
o Data::Object::Prototype
o Data::Object::Signatures

AUTHOR

Al Newkirk <anewkirk@ana.io>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Al Newkirk.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DATA::OBJECT::SYNTAX (3) 2015-11-29

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.