Rose::...:BigNum(3pm)
πΈ NAME πΈ
okay so welcome to Rose::DB::Object::MakeMethods::BigNum (3pm) β a user-contributed Perl documentation page, bestie β and it exists to create object methods for arbitrary-precision numeric attributes for Rose::DB::Object-derived objects. periodt. π
β¨ SYNOPSIS β¨
like, imagine your package is doing this:
package MyDBObject;
our @ISA = qw(Rose::DB::Object);
use Rose::DB::Object::MakeMethods::BigNum
(
bigint =>
[
count =>
{
with_init => 1,
min => 0,
},
# Important: specify very large integer values as strings
tally => { default => '9223372036854775800' },
],
);
sub init_count { 12345 }
...
$obj = MyDBObject->new(...);
print $obj->count; # 12345
print $obj->tally; # 9223372036854775800
the output is literally 12345 and 9223372036854775800, no cap. β¨
π DESCRIPTION π
Rose::DB::Object::MakeMethods::BigNum is a method maker that inherits from Rose::Object::MakeMethods. if you wanna learn about the interface, go read the Rose::Object::MakeMethods documentation β it's giving the whole blueprint. the method types this module gives you are described below, bestie.
all method types defined by this module are designed to work with objects that are subclasses of (or otherwise conform to the interface of) Rose::DB::Object. see the Rose::DB::Object documentation for more details. π«Ά
π METHODS TYPES π
π§ bigint π§
create get/set methods for big integer attributes. values are stored internally and returned as Math::BigInt objects. when specifying very large integer values, use strings to be safe. (there's an example in the synopsis above, bestie.) π₯
π Options π
check_in ARRAYREFβ a reference to an array of valid values. when setting the attribute, if the new value is not equal to one of the valid values, a fatal error will occur. it's giving strict.default VALUEβ determines the default value of the attribute. standard.hash_key NAMEβ the key inside the hash-based object to use for the storage of this attribute. defaults to the name of the method. iykyk.init_method NAMEβ the name of the method to call when initializing the value of an undefined attribute. defaults to the method name with the prefix"init_"added. this option implies"with_init". noted.interface NAMEβ choose the interface. the default is"get_set". pick your fighter.max INTβ get or set the maximum value this attribute is allowed to have. ceiling vibes.min INTβ get or set the minimum value this attribute is allowed to have. floor vibes.with_init BOOLβ modifies the behavior of the"get_set"and"get"interfaces. if the attribute is undefined, the method specified by the"init_method"option is called and the attribute is set to the return value of that method. auto-fill era.
π Interfaces π
Interfaces (yes, the original lists it twice β we are keeping that energy, no erasure π)
get_setβ creates a get/set method for a big integer object attribute. when called with an argument, the value of the attribute is set. the current value of the attribute is returned. classic.getβ creates an accessor method for a big integer object attribute that returns the current value of the attribute. just read the room.setβ creates a mutator method for a big integer object attribute. when called with an argument, the value of the attribute is set. if called with no arguments, a fatal error will occur. no silent nonsense.
Example:
package MyDBObject;
our @ISA = qw(Rose::DB::Object);
use Rose::DB::Object::MakeMethods::BigNum
(
bigint =>
[
count =>
{
with_init => 1,
min => 0,
},
# Important: specify very large integer values as strings
tally => { default => '9223372036854775800' },
],
);
sub init_count { 12345 }
...
$obj = MyDBObject->new(...);
print $obj->count; # 12345
print $obj->tally; # 9223372036854775800
$obj->count(-1); # Fatal error: minimum value is 0
π AUTHOR π
John C. Siracusa (siracusa@gmail.com) β icon. π
π LICENSE π
Copyright (c) 2010 by John C. Siracusa. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page, bestie. this footer tea is: perl v5.40.1, dated 2025-08-21, and the page name is Rose::...:BigNum(3pm). mwah π
π¦ where this page comes from
- ubuntu resolute: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms