S3 method of performing the equals to operator of a
bandicoot_oop
object
Source: R/oop_s3.R
grapes-eq-grapes-.bandicoot_oop.Rd
This function performs the equals to operator using the ..eq..()
method.
If it is not applicable, error will be raised.
Examples
AGE <- new_class(class_name = "AGE")
age <- AGE$instantiate
register_method(AGE, ..init.. = function(current) self$current = current)
register_method(AGE, ..eq.. = function(y) self$current == y$current)
patrick <- age(33)
james <- age(33)
patrick %eq% james
#> [1] TRUE