Sha256: 4611e7e3c9ef567b948ba062b629a7dc6cd7f093faa0050fb23b365a17a93507
Contents?: true
Size: 493 Bytes
Versions: 73
Compression:
Stored size: 493 Bytes
Contents
package RobotName; use warnings; use strict; sub new { my $class = shift; return bless {}, $class; } sub name { my $self = shift; return exists $self->{name} ? $self->{name} : $self->reset_name(); } sub reset_name { my $self = shift; $self->{name} = _rand_letter() . _rand_letter() . _suffix(); return $self->{name}; } sub _rand_letter { my @letters = 'A'..'Z'; return $letters[int rand $#letters]; } sub _suffix { return 100 + int rand 900; } 1;
Version data entries
73 entries across 73 versions & 1 rubygems