The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Venus::Kind::Value - Value Base Class

ABSTRACT

Value Base Class for Perl 5

SYNOPSIS

  package Example;

  use Venus::Class;

  extends 'Venus::Kind::Value';

  package main;

  my $example = Example->new;

  # $example->defined;

DESCRIPTION

This package provides identity and methods common across all Venus value classes.

INHERITS

This package inherits behaviors from:

Venus::Kind

INTEGRATES

This package integrates behaviors from:

Venus::Role::Accessible

Venus::Role::Buildable

Venus::Role::Explainable

Venus::Role::Pluggable

Venus::Role::Valuable

METHODS

This package provides the following methods:

defined

  defined() (Int)

The defined method returns truthy or falsy if the underlying value is "defined".

Since 0.01

defined example 1
  package main;

  my $example = Example->new;

  my $defined = $example->defined;

  # 0
defined example 2
  package main;

  my $example = Example->new(time);

  my $defined = $example->defined;

  # 1

explain

  explain() (Any)

The explain method returns the value set and is used in stringification operations.

Since 0.01

explain example 1
  package main;

  my $example = Example->new('hello, there');

  my $explain = $example->explain;

  # "hello, there"

AUTHORS

Cpanery, cpanery@cpan.org

LICENSE

Copyright (C) 2021, Cpanery

Read the "license" file.