NAME
Farly::Value::Integer - Integer wrapper class
SYNOPSIS
use Farly::Value::Integer;
my $integer_1 = Farly::Value::Integer->new( 2 );
my $integer_2 = Farly::Value::Integer->new( 3 );
print $integer_1->as_string();
$integer_1->equals( $integer_2 ) ? print "Yes, the objects are equal";
DESCRIPTION
Farly::Value::Integer is a integer wrapper class for use as a value in a Farly::Object object.
METHODS
new( integer )
The constructor.
my $integer = Farly::Value::Integer->new( 345 );
Integer to be wrapped must be provided as an argument. Leading and trailing whitespace is stripped.
equals( <Farly::Value::Integer> )
Returns true if the wrapped integers are '=='
$integer_1->equals( $integer_2 );
contains( <Farly::Value::Integer> )
Returns true if the wrapped integers are '=='
$integer_1->contains( $integer_2 );
intersects( <Farly::Value::Integer> )
Returns true if the wrapped strings are '=='
$integer_1->intersects( $integer_2 );
gt( <Farly::Value::Integer> )
Returns true if this integer object is '>' other
$integer_1->gt( $integer_2 );
lt( <Farly::Value::Integer> )
Returns true if this integer object is '<' other
$integer_1->lt( $integer_2 );
incr( <Farly::Value::Integer> )
Add 1 to the integer. '++'
$integer_1->incr();
decr( <Farly::Value::Integer> )
Subtract 1 from the integer. '--'
$integer_1->decr();
number()
Returns the integer value
$integer_1->number();
as_string()
Returns the integer value
$integer_1->as_string();
COPYRIGHT AND LICENCE
Farly::Value::Integer Copyright (C) 2012 Trystan Johnson
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.