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
Venus::Core::Class(3) User Contributed Perl Documentation Venus::Core::Class(3)

Venus::Core::Class - Class Base Class

Class Base Class for Perl 5

  package User;
  use base 'Venus::Core::Class';
  package main;
  my $user = User->new(
    fname => 'Elliot',
    lname => 'Alderson',
  );
  # bless({fname => 'Elliot', lname => 'Alderson'}, 'User')

This package provides a class base class with class building and object construction lifecycle hooks.

This package inherits behaviors from:

Venus::Core

This package provides the following methods:

  does(string $name) (boolean)

The does method returns true if the object is composed of the role provided.

Since 1.00

does example 1
  # given: synopsis
  my $does = $user->does('Identity');
  # 0
    

  import(any @args) (any)

The import method invokes the "IMPORT" lifecycle hook and is invoked whenever the "use" in perlfunc declaration is used.

Since 2.91

import example 1
  package main;
  use User;
  # ()
    

  meta() (Venus::Meta)

The meta method returns a Venus::Meta objects which describes the package's configuration.

Since 1.00

meta example 1
  package main;
  my $user = User->new(
    fname => 'Elliot',
    lname => 'Alderson',
  );
  my $meta = $user->meta;
  # bless({...}, 'Venus::Meta')
    

  new(any %args | hashref $args) (object)

The new method instantiates the class and returns a new object.

Since 1.00

new example 1
  package main;
  my $user = User->new(
    fname => 'Elliot',
    lname => 'Alderson',
  );
  # bless({fname => 'Elliot', lname => 'Alderson'}, 'User')
    
new example 2
  package main;
  my $user = User->new({
    fname => 'Elliot',
    lname => 'Alderson',
  });
  # bless({fname => 'Elliot', lname => 'Alderson'}, 'User')
    

  unimport(any @args) (any)

The unimport method invokes the "UNIMPORT" lifecycle hook and is invoked whenever the "no" in perlfunc declaration is used.

Since 2.91

unimport example 1
  package main;
  no User;
  # ()
    

Awncorp, "awncorp@cpan.org"

Copyright (C) 2022, Awncorp, "awncorp@cpan.org".

This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.

2023-11-27 perl v5.40.2

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.