NAME

Data::Object::Integer

ABSTRACT

Data-Object Integer Class

SYNOPSIS

  use Data::Object::Integer;

  my $integer = Data::Object::Integer->new(9);

DESCRIPTION

Data::Object::Integer provides routines for operating on Perl 5 integer data. Integer methods work on data that meets the criteria for being an integer. An integer holds and manipulates an arbitrary sequence of bytes, typically representing numeric characters. Users of integers should be aware of the methods that modify the integer itself as opposed to returning a new integer. Unless stated, it may be safe to assume that the following methods copy, modify and return new integers based on their function.

METHODS

This package implements the following methods.

defined

  defined() : NumObject

The defined method returns true if the object represents a value that meets the criteria for being defined, otherwise it returns false. This method returns a Data::Object::Number object.

defined example
  # given $integer

  $integer->defined; # 1

downto

  downto(Int $arg1) : ArrayObject

The downto method returns an array reference containing integer decreasing values down to and including the limit. This method returns a Data::Object::Array object.

downto example
  # given 1

  $integer->downto(0); # [1,0]

eq

  eq(Any $arg1) : NumObject

The eq method performs a numeric equality operation. This method returns a Data::Object::Number object representing a boolean.

eq example
  # given 1

  $integer->eq(1); # 1

ge

  ge(Any $arg1) : NumObject

The ge method returns true if the argument provided is greater-than or equal-to the value represented by the object. This method returns a Data::Object::Number object.

ge example
  # given 1

  $integer->ge(0); # 1

gt

  gt(Any $arg1) : NumObject

The gt method performs a numeric greater-than comparison. This method returns a Data::Object::Number object representing a boolean.

gt example
  # given 1

  $integer->gt(1); # 0

le

  le(Any $arg1) : NumObject

The le method returns true if the argument provided is less-than or equal-to the value represented by the object. This method returns a Data::Object::Number object.

le example
  # given 0

  $integer->le(1); # 1

lt

  lt(Any $arg1) : NumObject

The lt method performs a numeric less-than comparison. This method returns a Data::Object::Number object representing a boolean.

lt example
  # given 1

  $integer->lt(1); # 0

ne

  ne(Any $arg1) : NumObject

The ne method performs a numeric equality operation. This method returns a Data::Object::Number object representing a boolean.

ne example
  # given 1

  $integer->ne(0); # 1

new

  new(Int $arg1) : IntObject

The new method expects a number and returns a new class instance.

new example
  # given 9

  my $integer = Data::Object::Integer->new(9);

roles

  roles() : ArrayRef

The roles method returns the list of roles attached to object. This method returns a Data::Object::Array object.

roles example
  # given $integer

  $integer->roles;

rules

  rules() : ArrayRef

The rules method returns consumed rules.

rules example
  my $rules = $integer->rules();

to

  to(Int $arg1) : ArrayObject

The to method returns an array reference containing integer increasing or decreasing values to and including the limit in ascending or descending order based on the value of the floating-point object. This method returns a Data::Object::Array object.

to example
  # given 1

  $integer->to(2); # [1,2]
  $integer->to(0); # [1,0]

upto

  upto(Int $arg1) : Any

The upto method returns an array reference containing integer increasing values up to and including the limit. This method returns a Data::Object::Array object.

upto example
  # given 1

  $integer->upto(2); # [1,2]

ROLES

This package inherits all behavior from the folowing role(s):

RULES

This package adheres to the requirements in the folowing rule(s):