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

Venus::Sealed - Sealed Class

Sealed Class for Perl 5

  package main;
  use Venus::Sealed;
  my $sealed = Venus::Sealed->new('012345');
  # $sealed->get;
  # '012345'

This package provides a mechanism for sealing object and restricting and/or preventing access to the underlying data structures. This package can be used directly but is meant to be subclassed.

This package integrates behaviors from:

Venus::Role::Buildable

Venus::Role::Catchable

Venus::Role::Proxyable

Venus::Role::Throwable

Venus::Role::Tryable

This package provides the following methods:

  get(any @args) (any)

The get method can be used directly to get the sealed value set during instantiation, but is meant to be overridden in a subclass to further control access to the underlying data.

Since 3.55

get example 1
  # given: synopsis
  package main;
  my $get = $sealed->get;
  # "012345"
    
get example 2
  package Example;
  use Venus::Class;
  base 'Venus::Sealed';
  sub __get {
    my ($self, $init, $data) = @_;
    return $data->{value};
  }
  sub __set {
    my ($self, $init, $data, $value) = @_;
    return $data->{value} = $value;
  }
  package main;
  my $sealed = Example->new("012345");
  my $get = $sealed->get;
  # "012345"
    

  set(any @args) (any)

The set method can be used directly to set the sealed value set during instantiation, but is meant to be overridden in a subclass to further control access to the underlying data.

Since 3.55

set example 1
  # given: synopsis
  package main;
  my $set = $sealed->set("098765");
  # "098765"
    
set example 2
  package Example;
  use Venus::Class;
  base 'Venus::Sealed';
  sub __get {
    my ($self, $init, $data) = @_;
    return $data->{value};
  }
  sub __set {
    my ($self, $init, $data, $value) = @_;
    return $data->{value} = $value;
  }
  package main;
  my $sealed = Example->new("012345");
  my $set = $sealed->set("098765");
  # "098765"
    

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.