The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::Object::XPath::Number - HTML Object XPath Number Class

SYNOPSIS

    use HTML::Object::XPath::Number;
    my $num = HTML::Object::XPath::Number->new || 
        die( HTML::Object::XPath::Number->error, "\n" );

VERSION

    v0.2.0

DESCRIPTION

This module holds simple numeric values. It doesn't support -0, +/- Infinity, or NaN, as the XPath spec says it should.

METHODS

new

Provided with a number and this creates a new HTML::Object::XPath::Number object, with the value in number. Does some rudimentary numeric checking on number to ensure it actually is a number.

as_string

Returns a string representation of the number, or NaN is undefined.

as_xml

Same as "as_string", but in xml format.

cmp

Returns the equivalent of perl's own "cmp" in perlop operation.

evaluate

Returns the current object.

getAttributes

Returns an empty array reference in scalar context and an empty list in list context.

getChildNodes

Returns an empty array reference in scalar context and an empty list in list context.

new_literal

Returns a new HTML::Object::XPath::Literal object, passing it whatever arguments was provided.

string_value

Returns the value of the current object by calling "value"

to_boolean

Returns true if the current object has a true value, or false otherwise.

to_literal

Returns a new HTML::Object::XPath::Litteral object of the stringification of the current object.

to_number

Returns the current object.

value

This returns the numeric value held. This is also the method used to return the value from strinfgification.

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

HTML::Object::XPath, HTML::Object::XPath::Boolean, HTML::Object::XPath::Expr, HTML::Object::XPath::Function, HTML::Object::XPath::Literal, HTML::Object::XPath::LocationPath, HTML::Object::XPath::NodeSet, HTML::Object::XPath::Number, HTML::Object::XPath::Root, HTML::Object::XPath::Step, HTML::Object::XPath::Variable

COPYRIGHT & LICENSE

Copyright(c) 2021 DEGUEST Pte. Ltd.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.