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
Data::Object::Role::Arguable(3) User Contributed Perl Documentation Data::Object::Role::Arguable(3)

Data::Object::Role::Arguable

Arguable Role for Perl 5 Plugin Classes

  package Example;

  use Moo;

  with 'Data::Object::Role::Arguable';

  has name => (
    is => 'ro'
  );

  has options => (
    is => 'ro'
  );

  sub argslist {
    ('name', '@options')
  }

  package main;

  my $example = Example->new(['james', 'red', 'white', 'blue']);

This package provides a mechanism for unpacking an argument list and creating a data structure suitable for passing to the consumer constructor. The "argslist" routine should return a list of attribute names in the order to be parsed. An attribute name maybe prefixed with "@" to denote that all remaining items should be assigned to an arrayref, e.g. @options, or "%" to denote that all remaining items should be assigned to a hashref, e.g. %options.

This package uses type constraints from:

Types::Standard

This package implements the following methods:

  packargs() : HashRef

The packargs method uses "argslist" to return a data structure suitable for passing to the consumer constructor.

packargs example #1
  package main;

  my $example = Example->new;

  my $attributes = $example->packargs('james', 'red', 'white', 'blue');
    

  unpackargs(Any @args) : (Any)

The unpackargs method uses "argslist" to return a list of arguments from the consumer class instance in the appropriate order.

unpackargs example #1
  package main;

  my $example = Example->new(['james', 'red', 'white', 'blue']);

  my $arguments = [$example->unpackargs];
    

Al Newkirk, "awncorp@cpan.org"

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 in the "license file" <https://github.com/iamalnewkirk/foobar/blob/master/LICENSE>.

Wiki <https://github.com/iamalnewkirk/foobar/wiki>

Project <https://github.com/iamalnewkirk/foobar>

Initiatives <https://github.com/iamalnewkirk/foobar/projects>

Milestones <https://github.com/iamalnewkirk/foobar/milestones>

Contributing <https://github.com/iamalnewkirk/foobar/blob/master/CONTRIBUTE.md>

Issues <https://github.com/iamalnewkirk/foobar/issues>

2020-04-19 perl v5.32.1

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

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