Class::Trait::Lib::TEquality(3pm)

Class::Trait::Lib::TEquality3pm

Trait for adding equality testing to your object

Overview

TEquality adds a number of equality testing features, including type-equality as well as object instance equality.

Requires

equalTo ($left, $right)

The "equalTo" method is expected to return either true if its two arguments are equal (by whatever standards your devise), or false if they are not.

Overloads

==
!=

Provides

notEqualTo ($left, $right)

This is the inverse of "equalTo".

isSameTypeAs ($left, $right)

This will determine type equality, meaning it will determine if both arguements are derived from the same type.

isExactly ($left, $right)

This will attempt to discern whether or not the two arguments given are the same object. It even takes into account the possibility that the objects might also have utilized the TPrintable trait, and so works around that automatic stringification.

Releases

7 releases since Debian 5.0 (Lenny); the text changed 3 times.

  1. 5.0
  2. 6.0–7
  3. 8–10
  4. 11

Author

Stevan Little <[email protected]>

From libclass-trait-perl 0.31-4.1 in Debian 11 (Bullseye). Parsed by carta from the page's man source.