|
NAMEData::Object::Args - Args Class ABSTRACTArgs Class for Perl 5 SYNOPSIS package main;
use Data::Object::Args;
local @ARGV = qw(--help execute);
my $args = Data::Object::Args->new(
named => { flag => 0, command => 1 }
);
# $args->flag; # $ARGV[0]
# $args->get(0); # $ARGV[0]
# $args->get(1); # $ARGV[1]
# $args->action; # $ARGV[1]
# $args->exists(0); # exists $ARGV[0]
# $args->exists('flag'); # exists $ARGV[0]
# $args->get('flag'); # $ARGV[0]
DESCRIPTIONThis package provides methods for accessing @ARGS items. INTEGRATESThis package integrates behaviors from: Data::Object::Role::Buildable Data::Object::Role::Proxyable Data::Object::Role::Stashable LIBRARIESThis package uses type constraints from: Types::Standard ATTRIBUTESThis package has the following attributes: namednamed(HashRef) This attribute is read-only, accepts "(HashRef)" values, and is optional. METHODSThis package implements the following methods: existsexists(Str $key) : Any The exists method takes a name or index and returns truthy if an associated value exists.
getget(Str $key) : Any The get method takes a name or index and returns the associated value.
namename(Str $key) : Any The name method takes a name or index and returns index if the the associated value exists.
setset(Str $key, Maybe[Any] $value) : Any The set method takes a name or index and sets the value provided if the associated argument exists.
stashedstashed() : HashRef The stashed method returns the stashed data associated with the object.
unnamedunnamed() : ArrayRef The unnamed method returns an arrayref of values which have not been named using the "named" attribute.
AUTHORAl Newkirk, "awncorp@cpan.org" LICENSECopyright (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/data-object-args/blob/master/LICENSE>. PROJECTWiki <https://github.com/iamalnewkirk/data-object-args/wiki> Project <https://github.com/iamalnewkirk/data-object-args> Initiatives <https://github.com/iamalnewkirk/data-object-args/projects> Milestones <https://github.com/iamalnewkirk/data-object-args/milestones> Contributing <https://github.com/iamalnewkirk/data-object-args/blob/master/CONTRIBUTE.md> Issues <https://github.com/iamalnewkirk/data-object-args/issues>
|