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
Astro::App::Satpass2::Copier(3) User Contributed Perl Documentation Astro::App::Satpass2::Copier(3)

Astro::App::Satpass2::Copier - Object copying functionality for Astro::App::Satpass2

 package Astro::App::Satpass2::Foo;
 
 use strict;
 use warnings;
 
 use parent qw{ Astro::App::Satpass2::Copier };
 
 sub new { ... }
 
 sub attribute_names {
     return ( qw{ bar baz } );
 }
 
 __PACKAGE__->create_attribute_methods();
 
 1;

This class is private to the Astro::App::Satpass2 package. The author reserves the right to modify it in any way or retract it without prior notice.

This class supports the following public methods:

warner

 $obj->warner( undef );
 my $warner = $obj->warner();

This method is both accessor and mutator for the "warner" attribute.

If an argument is passed, it must be either an Astro::App::Satpass2::Warner (either class or object), or "undef" (which causes a new Astro::App::Satpass2::Warner object to be created.)

If no argument is passed, it is an accessor, returning the warner object. If no such object has been assigned, one will be generated.

 print join( ', ', $obj->attribute_names() ), "\n";

This method returns the names of the object's attribute_names.

Subclasses should override this. Immediate subclasses should call "SUPER::attribute_names()", and indirect subclasses must call "SUPER::attribute_names()". A subclass' override would look something like this:

 sub attribute_names {
     my ( $self ) = @_;
     return ( $self->SUPER::attribute_names(), qw{ foo bar baz } );
 }

 say 'I am a ', $obj->class_name_of_record();

This method returns the class name of record of the object. By default this is simply the name of the object's class (i.e. "ref $obj", but subclasses can override this to hide implementation details.

 my $clone = $obj->clone();

This method returns a clone of the original object, taken using "Clone::clone()".

Overrides "may" call "SUPER::clone()". If they do not they bear complete responsibility for producing a correct clone of the original object.

 $obj->copy( $copy, %skip );

This method copies the attribute values of the original object into the attribute_names of the copy object. The original object is returned.

The %skip hash is optional. Any attribute that appears in the %skip hash is skipped. Note that you can also pass an array here provided it has an even number of elements; the even-numbered elements (from zero) will be taken as the attribute names.

The copy object need not be the same class as the original, but it must support all attributes the original supports.

 __PACKAGE__->create_attribute_methods();

This method may be called exactly once by the subclass to create accessor/mutator methods. This method assumes that the object is based on a hash reference, and stores attribute values in same-named keys in the hash. The created methods have the same names as the attributes. They are accessors if called without arguments, and mutators returning the original object if called with arguments. Methods already in existence when this method is called will not be overridden.

 $obj->init( name => value ... );

This method sets multiple attributes. It dies if any of the names does not represent a legal attribute name. It returns the invocant.

wail

 $self->wail( 'Something bad happened' );

This convenience method simply wraps "$self->warner()->wail()".

weep

 $self->weep( 'Something really horrible happened' );

This convenience method simply wraps "$self->warner()->weep()".

whinge

 $self->whinge( 'Something annoying happened' );

This convenience method simply wraps "$self->warner()->whinge()".

Support is by the author. Please file bug reports at <https://rt.cpan.org/Public/Dist/Display.html?Name=Astro-App-Satpass2>, <https://github.com/trwyant/perl-Astro-App-Satpass2/issues>, or in electronic mail to the author.

Thomas R. Wyant, III wyant at cpan dot org

Copyright (C) 2010-2021 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

2021-11-04 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.